| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- <!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="../css/init.css" />
- <title>办理工单</title>
- <style>
- .input {
- background-color: #FFF;
- background-image: none;
- border: 1px solid #ccc;
- border-radius: 1px;
- color: inherit;
- padding: 6px 12px
- }
-
- .fjnr {
- padding: 0!important;
- border: none!important;
- }
- .HGXX td{
- padding: 8px;
- }
- </style>
- </head>
- <body>
- <div class="Common" style="padding: 10px;">
- <table class="table" border="" cellspacing="0" cellpadding="0" style="border: 1px solid #e7eaec; text-align: center;">
- <theard>
- <tr>
- <td class="text-center" style="min-width: 100px; text-align: center;">办理人</td>
- <td class="text-center" style="min-width: 100px; text-align: center;">办理时间</td>
- <td class="text-center" style="min-width: 100px; text-align: center;">内容</td>
- <td class="text-center" style="min-width: 100px; text-align: center;">附件</td>
- </tr>
- </theard>
- <tbody class="BLNR" style="border-top: none; padding: 8px;">
- </tbody>
- <!--<div class="FJ">
-
- </div>-->
- </table>
- <table>
- <tr>
- <th class="Importent" style="text-align: left;"> 审核意见:</th>
- </tr>
- <tr>
- <td style="padding: 0px;"><textarea data-adaptheight id="reason" name="" rows="" cols="" style="text-indent: 2em;"></textarea></td>
- <input type="hidden" id="ID"/>
- </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/adjustHeight.js" ></script>
- <script>
- var wid = helper.request.queryString("wid");
- var State;
- var a=$("#ID").val()
- Detail();
- $(document).ready(function() {
- // HGXX();
- BLNR();
- Hove();
-
- //上传附件
- $("#scwj").click(function() {
- $("#upFile").trigger("click");
- })
- $("#upFile").change(function() {
- upload();
- })
- $("#scfj").click(function() {
- $(".fjnr").text("");
- $("#scfj").hide();
- })
- $('.BC').click(function() {
- if($("#reason").val()==""){
- layer.msg("请填写审核意见");
- }else{
- State = 1;
- JA();
- }
-
- })
- $('.Submit').click(function() {
- if($("#reason").val()==""){
- layer.msg("请填写审核意见");
- }else{
- State = 2;
- JA();
- }
- })
- });
- //审批意见
- function JA() {
- $.post(huayi.config.callcenter_url + 'WorkOrder/AuditSplitWorkOrder', {
- workorderid: wid,
- reason: $('#reason').val(), //办理内容
- state: State,
- backid:ccc,
- token: $.cookie("token")
- }, function(result) {
- result = JSON.parse(result);
- if(result.state.toLowerCase() == "success") {
- var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- parent.layer.close(index); //再执行关闭
- parent.load();
- parent.layer.msg("处理成功");
- }
- })
- }
- // 工单详情
- // function HGXX() {
- // $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetSecondDealInfo', {
- // workorderid: wid,
- // token: $.cookie("token")
- // }, function(result) {
- // // result = JSON.stringify(result)
- // if(result.state.toLowerCase() == "success") {
- // var temp;
- // $.each(result.data.pdinfo,function(i, n) {
- // var i=0;
- // i++;
- // temp = temp + '<td class="text-center">'+i+'</td><td class="text-center">'+n.F_CreateTime+'</td><td class="text-center">'+n.F_AssignedOpinion+'</td><td class="text-center">'+n.F_LimitTime+'</td><td class="text-center">'+n.F_OtherDeptIds+'</td>';
- //// ccc=n.F_Id;
- //
- // });
- //
- // $('.HGXX').append(temp);
- // }
- // })
- // }
- //办理内容
- function BLNR() {
- $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetNewSecondDealInfo', {
- workorderid: wid,
- token: $.cookie("token")
- }, function (result) {
- if (result.state.toLowerCase() == "success") {
- var temp1;
- $.each(result.data, function (i, n) {
- temp1 = temp1 + '<td class="text-center">' + n.F_DealUser + '</td><td class="text-center">' + n.F_CreateTime + '</td><td class="text-center">' + n.F_Result + '</td><td class="text-center FJ" style="color:#00a1cb;"></td>';
- ccc = n.F_Id;
- });
- $('.BLNR').append(temp1);
- $(result.data[0].File).each(function (i, n) {
- HTML = '<a style="margin-right:5px;" href="' + n.F_FileUrl + '" download="' + n.F_FileName.substring(19)+ '">' + n.F_FileName.substring(19) + '</a>'
- $(HTML).appendTo($('.FJ'));
- })
- }
- })
- }
- // <a class="tiaozhuan" style="margin-left: -5px; width:100%; display:block; text-align: center;" href="' + (n.File == null ? '' : n.File[0].F_FileUrl) + '" download="' + (n.File == null ? '' : n.File[0].F_FileUrl) + '" >附件</a>
- // 判断附件
- function Hove(){
- $(document).on("mouseover mouseout",'.tiaozhuan',function(event){
- if(event.type == "mouseover"){
- //鼠标悬浮
- var miao=$(this).attr("href");
- if (miao=="") {
- $(this).removeAttr("href");
- $(this).removeAttr("download");
- $(this).html("")
- } else{
- $(this).attr("href");
- $(this).attr("download");
- }
- }else if(event.type == "mouseout"){
- //鼠标离开
- }
- })
- }
- //草稿详情
- function Detail() {
- $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetDraftInfo', {
- workorderid: wid,
- type: 2,
- token: $.cookie("token")
- }, function(result) {
- if (result.state.toLowerCase() == "success") {
- if (result.data.length > 0) {
- $("#dealman").val(result.data[0].F_DealUser);
- $('#result').val(result.data[0].F_Result);
- a = result.data[0].F_Id;
- };
- }
- })
- }
- //清除
- function Clean(){
- $("#startTime").val(''),
- $('#assignedopinion').val('')
- }
- //上传文件
- function upload() {
- var Files = document.getElementById("upFile").files;
- if (Files.length > 0) {
- var formData = new FormData();
- for (var i = 0; i < Files.length; i++) {
- formData.append('file' + i, Files[i]);
- }
- formData.append("token", $.cookie("token"));
- $.ajax({
- url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
- type: "POST",
- data: formData,
- /**
- *必须false才会自动加上正确的Content-Type
- */
- contentType: false,
- /**
- * 必须false才会避开jQuery对 formdata 的默认处理
- * XMLHttpRequest会对 formdata 进行正确的处理
- */
- processData: false,
- success: function (result) {
- document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
- $("#upFile").change(function () {
- upload();
- });
- var r = $.parseJSON(result);
- if (r.state.toLowerCase() == "success") {
- $(".fjnr").text(r.data[0].F_FileName);
- var a = r.data;
- $(a).each(function (i, n) {
- var strs = '<span class="files" fiel-num="' + n.F_FileId + '">' + n.F_FileName.substring(19) + '<i class="fa fa-remove del_file"></i></span>'
- $(strs).appendTo($('.fileBox')).find('.del_file').click(function (event) {
- event.stopPropagation();
- $(this).parent().remove();
- file_num()
- })
- })
- file_num();
- }
- }
- });
- } else {
- layer.confirm('请上传文件!', {
- btn: ['确定']
- });
- }
- }
- //上传文件隐藏域值
- function file_num(){
- var str = '';
- var Str;
- $('.fileBox .files').each(function(j,m){
- var aa=$(m).attr("fiel-num")
- console.log(aa);
- str += aa + ",";
- Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
- })
- $("#file").val(Str);
- }
- </script>
- </body>
- </html>
|