| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- mui.init({})
- var id = helper.request.queryString("id");
- var state = helper.request.queryString("type");
- var openid = helper.cookies.get("openid");
- //var openid = "oXF5e1mWpX5DajW5_yjNLPKb8ThE";
- var roleCode = helper.cookies.get("RoleCode");
- var backType=0,turn=1;
- if (!openid) {
- var openid = helper.request.queryString("openid");
- }
- function formatterDealDetail(val, row) {
- return str;
- }
- if (roleCode=="JDYPTZX"||roleCode=="JDYBZZX") {
- $(".sendBackBtn").remove();
- } else if(roleCode=="JG"){
- $(".sendBackBtn").show();
- $(".unusualBtn").show();
- }else if(roleCode=="BLRY"){
- $(".unusualBtn").show();
- $(".allotBtn").hide();
- backType=1;
- }
- $(function () {
- Ajax();
- if (state=="0") {
- $(".dispose1").show();
- } else if (state=="1") {
- $(".dispose2").show();
- } else if(state=="2"){
- $(".dispose3").show();
- } else if(state=="3"){
- $(".dispose4").show();
- }
- //返回列表
- $('.return').on('tap', function() {
- if (state==0) {
- window.location.href = "orderList.html?Itype=" + state+'&turn='+turn;
- }else if (state==1) {
- window.location.href = "orderList.html?Itype=" + state+'&turn='+turn;
- }else if (state==2) {
- window.location.href = "orderList.html?Itype=" + state+'&turn='+turn;
- } else if (state==3){
- window.location.href = "orderList.html?Itype=" + state+'&turn='+turn;
- }else if (state==4){
- window.location.href = "orderList.html?Itype=" + state+'&turn='+turn;
- }
- //window.location.href = "client_index.html?Itype=" + itype;
- });
- })
- //接单
- $(".redeploy").click(function(){
- var btnArray = ['否', '是'];
- mui.confirm('确定接单?', '提示', btnArray, function(f) {
- if(f.index == 1) {
- $.ajax({
- type: "post",
- dataType: 'json',
- url: huayi.config.callcenter_url + '/WxLogin/SureWorkOrder',
- async: true,
- data: {
- orderid: id, //否 strubg 工单编号
- openid: openid, //微信openid 测试用
- },
- success: function(data) {
- if(data.state == "success") {
- debugger
- mui.toast('接单成功');
- window.location.href = "orderList.html?Itype=1";
- } else {
- mui.toast(data.message);
- }
- }
- });
- } else {
- mui.toast("取消");
- }
- })
- })
- //退回
- $(".backBtn").click(function(){
- $(".pop_up_bj").fadeIn();
- $(".pop_up_div3").fadeIn();
- backType=0;
- itype=1;
- })
- $(".unusualBtn").click(function(){
- $(".pop_up_bj").fadeIn();
- $(".pop_up_div3").fadeIn();
- backType=1;
- itype=2;
- })
- $(".pop_up_bj" ).click(function(){
- $(".pop_up_bj").hide();
- $(".pop_up_div3").hide();
-
- })
- $(".pop_up_div3 .btn .fl" ).click(function(){
- $(".pop_up_bj").hide();
- $(".pop_up_div3").hide();
- mui.alert("取消");
- })
- $(".pop_up_div3 .btn .fr").click(function(){
- if($(".textcont_back").val()=="") {
- mui.alert("请输入退回内容");
- }else{
- $(".pop_up_bj").hide();
- $(".pop_up_div3").hide();
- $.ajax({
- type: "post",
- dataType: 'json',
- url: huayi.config.callcenter_url + '/WxLogin/BackWorkOrder',
- async: true,
- data: {
- openid: openid, //微信openid 测试用
- orderid: id, //否 strubg 工单编号
- cont:$(".textcont_back").val(),
- type:backType,
- },
- success: function(data) {
- if(data.state == "success") {
- debugger
- mui.toast('退回成功');
- window.location.href = "orderList.html?Itype="+itype;
- } else {
- mui.toast(data.message);
- }
- }
- });
- }
-
- })
-
- //处理
- $(".deal").click(function(){
- $(".pop_up_bj").fadeIn();
- $(".pop_up_div4").fadeIn();
- })
- $(".pop_up_bj" ).click(function(){
- $(".pop_up_bj").hide();
- $(".pop_up_div4").hide();
- })
- $(".pop_up_div4 .btn .fl" ).click(function(){
- $(".pop_up_bj").hide();
- $(".pop_up_div4").hide();
- mui.alert("取消");
- })
- $(".pop_up_div4 .btn .fr" ).click(function(){
- $(".pop_up_bj").hide();
- $(".pop_up_div4").hide();
- if($(".textcont_deal").val()=="") {
- mui.alert("请输入处理内容");
- }else{
- $(".pop_up_bj").hide();
- $(".pop_up_div4").hide();
- $.ajax({
- type: "post",
- dataType: 'json',
- url: huayi.config.callcenter_url + '/WxLogin/DealWorkOrder',
- async: true,
- data: {
- orderid: id, //否 strubg 工单编号
- isover:$('.order_state').find('input[type="radio"]:checked').val(), //处理状态
- cont: $(".textcont_deal").val(), //否 int 处理内容
- openid: openid, //微信openid,
- },
- success: function(data) {
- if(data.state == "success") {
- debugger
- mui.toast('处理成功');
- window.location.href = "orderList.html?Itype=2";
- } else {
- mui.toast(data.message);
- }
- }
- });
- }
-
- })
- $(".allot").click(function(){
- window.location.href = "redeploy.html?id=" + id + '&itype=' + state;
- })
- function Ajax() {
- $.ajax({
- url: huayi.config.callcenter_url + '/WxLogin/GetWoInfo',
- data: {
- workorderid: id, //工单编号
- openid: openid, //微信openid,
- },
- async: true,
- dataType: 'json',
- type: 'get', //HTTP请求类型
- success: function(data) {
- if(data.state.toLowerCase() == "success") {
- var result = data.data.data[0]
- var stateText
- if (result.State==0) {
- stateText="待指派"
- }else if(result.State==1){
- stateText="待接单"
- }else if(result.State==2){
- stateText="待处理"
- $(".allotBtn").hide();
- }else if(result.State==3){
- stateText="退回待处理"
- }else if(result.State==4){
- stateText="异常退回待处理"
- }else if(result.State==5){
- stateText="处理中"
- }else if(result.State==10){
- stateText="已完结"
- }
- console.log(result.State);
- $("#workOrderID").text(result.WorkOrderID); //工单编号
- $("#gdlxName").text(result.GDLXName); //工单类型
- $("#gdlyName").text(result.GDLYName); //工单来源
- $("#state").text(stateText); //工单状态
- $("#customer").text(result.Customer); //客户姓名
- if (state==3) {
- var str="";
- var val1 = result.CustomerTel.substring(0, 3);
- var val2 = result.CustomerTel.substr(-4);
- str = val1 + '****' + val2;
- $("#customerTel").text(str); //客户电话
- }else{
- $("#customerTel").text(result.CustomerTel); //客户电话
- }
-
- $("#state").text(stateText); //工单状态
- $("#ywlxName").text(result.YWLXName); //业务类型
- $("#detail").text(result.Detail); //工单内容
- //$("#Work_areaname").attr('data-index',result.IsAdminSend);
- var record=data.data.item;
- if(data.data.item &&record.length > 0) {
- $(record).each(function(i, row) {
- $('<h5 class="mui-badge-success mui-badge-inverted">' + record[i].F_CreateTime+
- '</h5><h5><span style="line-height: 20px;">跟踪信息:'+
- '</span><span class="Font" style="line-height: 20px;">' + record[i].F_OptContent +
- '</span></h5>').appendTo("#GDgz")
-
- })
- }
- }
- },
- error: function(xhr, type, errorThrown) {
- //异常处理;
- }
- })
- }
|