| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391 |
- window.onload = function() {
- mui.plusReady(function() {
- //var isdeal=helper.request.queryString("isdeal");
- var token = localStorage.getItem("token");
- var F_See = localStorage.getItem("F_See");
- var wv = plus.webview.currentWebview();
- var importClass = wv.importClass; //工单等级
- var choujian = wv.choujian; //抽检
- var keyw="",classImport = "",index=0,dataIndex=1,total,pageSize = 10,page = 1;
- plus.nativeUI.closeWaiting();
- //显示当前页面
-
- mui.currentWebview.show();
- if(localStorage.getItem("index")){
- index = localStorage.getItem("index");
- dataIndex = localStorage.getItem("dataIndex");
- areaId = localStorage.getItem("areaId");
- officeId = localStorage.getItem("officeId");
- $("#mui_list").find(".mui-control-item_1").removeClass("mui-active_q");
- $("#mui_list").find(".mui-control-item_1").eq(index).addClass("mui-active_q");
- }
- if(F_See == 0) { //调度
- $("#DW").css('display', 'block')
- } else{
- $("#DW").css('display', 'none')
- }
- Ajax();
- AjaxYcl();
- if(dataIndex==1){
- $("#pullrefresh").find(".mui-scroll_1").show();
- $("#pullrefresh").find(".mui-scroll_2").remove();
-
- }else if(dataIndex==2){
- $("#pullrefresh").find(".mui-scroll_1").remove();
- $("#pullrefresh").find(".mui-scroll_2").show();
-
- }
- $('.search').on('input focus', function() {
- keyw = $(this).val();
- page = 1;
- if (dataIndex==1) {
- Ajax(keyw);
- }else if (dataIndex==2) {
- AjaxYcl(keyw);
- }
- });
- mui.init({
- swipeBack: false,
- pullRefresh: {
- container: '#pullrefresh',
- up: {
- contentrefresh: "正在加载...", //可选,正在加载状态时,上拉加载控件上显示的标题内容
- contentnomore: '没有更多数据了', //可选,请求完毕若没有更多数据时显示的提醒内容;
- callback: pullupRefresh
- }
- }
- });
- function pullupRefresh() {
- setTimeout(function() {
- mui('#pullrefresh').pullRefresh().endPullupToRefresh((page++ >= Math.ceil(total / 10)));
- if (index==0) {
- $.ajax({
- data: {
- token: token,
- dealTimely: classImport,
- Processing:1,
- CJ:choujian,
- keywords:keyw,
- extensionphone: 1,
- area:areaId,
- offce:officeId,
- pageindex : page,
- pagesize: pageSize
- },
- url: huayi.config.callcenter_url + '/WorkorderApp/GetList',
- dataType: 'json', //服务器返回json格式数据
- type: 'get', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
- },
- success: function(data) {
-
- var total = data.total;
- if(!total) {
- total = 0;
- }
- for(var i = 0; i < data.rows.length; i++) {
- var a = data.rows[i].F_Remark;
- var c = data.rows[i].F_WorkState;
- var time = data.rows[i].F_CreateTime;
- var areaOffice;
- if (!data.rows[i].F_AreaName) {
- areaOffice='';
- }else{
- areaOffice='<p class="mui-h6 mui-ellipsis" style="padding-left: 15px;">' +
- '<span class="areaOffice">大区办事处:'+data.rows[i].F_AreaName +"-"+data.rows[i].F_OfficName+'</span>' +
- ' </p>'
- }
- imgnum = '<img src="../img/process_icon.png"/>';
- $('<li class="mui-table-view-cell orderli">' +
- '<div class="mui-table order" data-index="' + data.rows[i].F_Id + '">' +
- '<div class="mui-table-cell mui-col-xs-12">' +
- '<h5 class="mui-ellipsis new_title" >' + data.rows[i].F_Samplingproducts + '</h5>' +
- ' <p class="mui-h6 mui-ellipsis">' +
- '<span class="advice">' + a + '</span>' +
- ' </p>'+areaOffice+'<p class="mui-h6 mui-ellipsis">' +
- '<span class="time">投诉时间:' + time + '</span>' +
- ' </p></div></div>' +
- '<div class="class-state">' + imgnum +
- '</div>' +
- '</li>').appendTo('#order_listClz');
-
- }
- },
- error: function(xhr, type, errorThrown) {
- //异常处理;
- }
- })
- }else if(index==1){
- $.ajax({
- data: {
- token: token,
- dealTimely: classImport,
- Processing:2,
- keywords:keyw,
- area:areaId,
- offce:officeId,
- CJ:choujian,
- extensionphone: 1,
- pageindex: page,
- pagesize: pageSize
- },
- url: huayi.config.callcenter_url + '/WorkorderApp/GetList',
- dataType: 'json', //服务器返回json格式数据
- type: 'get', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
- },
- success: function(data) {
- var total = data.total;
- if(!total) {total = 0;}
- var imgnum;
- $(".class-icon img").hide()
- $(".ywcTotle").text('(' + total + ')');
- for(var i = 0; i < data.rows.length; i++) {
- var a = data.rows[i].F_Remark;
- var c = data.rows[i].F_WorkState;
- var time = data.rows[i].F_CreateTime;
- imgnum = '<img src="../img/comple_icon.png"/>';
- var areaOffice;
- if (!data.rows[i].F_AreaName) {
- areaOffice='';
- }else{
- areaOffice='<p class="mui-h6 mui-ellipsis" style="padding-left: 15px;">' +
- '<span class="areaOffice">大区办事处:'+data.rows[i].F_AreaName +"-"+data.rows[i].F_OfficName+'</span>' +
- ' </p>'
- }
- $('<li class="mui-table-view-cell orderli">' +
- '<div class="mui-table order" data-index="' + data.rows[i].F_Id + '">' +
- '<div class="mui-table-cell mui-col-xs-12">' +
- '<h5 class="mui-ellipsis new_title" >' + data.rows[i].F_QualityProblem + '</h5>' +
- ' <p class="mui-h6 mui-ellipsis">' +
- '<span class="advice">' + a + '</span>' +
- ' </p>'+areaOffice+'<p class="mui-h6 mui-ellipsis">' +
- '<span class="time">投诉时间:' + time + '</span>' +
- ' </p></div></div>' +
- '<div class="class-state">' + imgnum +
- '</div>' +
- '</li>').appendTo('#order_listYwc');
- }
- },
- error: function(xhr, type, errorThrown) {
- //异常处理;
- }
- })
- }
- }, 1000);
- }
-
- function Ajax() {
- $.ajax({
- data: {
- token: token,
- dealTimely: classImport,
- Processing:1,
- keywords:keyw,
- extensionphone: 1,
- area:areaId,
- offce:officeId,
- CJ:choujian,
- pageindex: 1,
- pagesize: 10
- },
- url: huayi.config.callcenter_url + '/WorkorderApp/GetList',
- dataType: 'json', //服务器返回json格式数据
- type: 'get', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
- },
- success: function(data) {
- var total = data.total;
- $(".orderli").remove();
- if(!total) {total = 0;}
- var imgnum;
- $(".class-icon img").hide()
- $(".clzTotle").text('(' + total + ')');
-
- for(var i = 0; i < data.rows.length; i++) {
- var a = data.rows[i].F_Remark;
- var c = data.rows[i].F_WorkState;
- var time = data.rows[i].F_CreateTime;
- var areaOffice;
- if (!data.rows[i].F_AreaName) {
- areaOffice='';
- }else{
- areaOffice='<p class="mui-h6 mui-ellipsis" style="padding-left: 15px;">' +
- '<span class="areaOffice">大区办事处:'+data.rows[i].F_AreaName +"-"+data.rows[i].F_OfficName+'</span>' +
- ' </p>'
- }
- imgnum = '<img src="../img/process_icon.png"/>';
- $('<li class="mui-table-view-cell orderli">' +
- '<div class="mui-table order" data-index="' + data.rows[i].F_Id + '">' +
- '<div class="mui-table-cell mui-col-xs-12">' +
- '<h5 class="mui-ellipsis new_title" >' + data.rows[i].F_Samplingproducts + '</h5>' +
- ' <p class="mui-h6 mui-ellipsis">' +
- '<span class="advice">' + a + '</span>' +
- ' </p>'+areaOffice+'<p class="mui-h6 mui-ellipsis">' +
- '<span class="time">投诉时间:' + time + '</span>' +
- ' </p></div></div>' +
- '<div class="class-state">' + imgnum +
- '</div>' +
- '</li>').appendTo('#order_listClz');
- }
-
- },
- error: function(xhr, type, errorThrown) {
- //异常处理;
- }
- })
-
- }
-
- function AjaxYcl() {
- $.ajax({
- data: {
- token: token,
- dealTimely: classImport,
- Processing:2,
- keywords:keyw,
- extensionphone: 1,
- area:areaId,
- offce:officeId,
- CJ:choujian,
- pageindex: 1,
- pagesize: 10
- },
- url: huayi.config.callcenter_url + '/WorkorderApp/GetList',
- dataType: 'json', //服务器返回json格式数据
- type: 'get', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
- },
- success: function(data) {
- var total = data.total;
- $(".orderli1").remove();
- if(!total) {total = 0;}
- var imgnum;
- $(".class-icon img").hide()
- $(".ywcTotle").text('(' + total + ')');
- for(var i = 0; i < data.rows.length; i++) {
- var a = data.rows[i].F_Remark;
- var c = data.rows[i].F_WorkState;
- var time = data.rows[i].F_CreateTime;
- imgnum = '<img src="../img/comple_icon.png"/>';
- var areaOffice;
- if (!data.rows[i].F_AreaName) {
- areaOffice='';
- }else{
- areaOffice='<p class="mui-h6 mui-ellipsis" style="padding-left: 15px;">' +
- '<span class="areaOffice">大区办事处:'+data.rows[i].F_AreaName +"-"+data.rows[i].F_OfficName+'</span>' +
- ' </p>'
- }
- $('<li class="mui-table-view-cell orderli1">' +
- '<div class="mui-table order" data-index="' + data.rows[i].F_Id + '">' +
- '<div class="mui-table-cell mui-col-xs-12">' +
- '<h5 class="mui-ellipsis new_title" >' + data.rows[i].F_Samplingproducts + '</h5>' +
- ' <p class="mui-h6 mui-ellipsis">' +
- '<span class="advice">' + a + '</span>' +
- ' </p>'+areaOffice+'<p class="mui-h6 mui-ellipsis">' +
- '<span class="time">投诉时间:' + time + '</span>' +
- ' </p></div></div>' +
- '<div class="class-state">' + imgnum +
- '</div>' +
- '</li>').appendTo('#order_listYwc');
- }
- },
- error: function(xhr, type, errorThrown) {
- //异常处理;
- }
- })
- }
-
- $('#mui_list').on('tap', '.mui-control-item_1', function() {
- index=$(this).index();
-
- dataIndex=$(this).attr("data-index");
- localStorage.setItem("index", index);
- localStorage.setItem("dataIndex", dataIndex);
- localStorage.setItem("areaId", areaId);
- localStorage.setItem("officeId", officeId);
- window.location.reload();
- })
- $(".tureBtn").click(function(){
- areaD(); officeD(); Ajax(); AjaxYcl();
- if ($('.grade-eject').hasClass('grade-w-roll')) {
- $('.grade-eject').removeClass('grade-w-roll');
- $(this).removeClass('current');
- setTimeout(function() {$(".grade-eject_bj").hide()},400)
- } else {
- $('.grade-eject').addClass('grade-w-roll');
- $(this).addClass('current');
- setTimeout(function() {$(".grade-eject_bj").show()},400)
- }
- })
-
- $('.order_list').on('tap', '.order', function() {
- var id = $(this).attr('data-index');
- var DetailID="WorkDetails";
- var DetailUrl="WorkDetails.html";
- if (choujian) {
- DetailID="WorkDetailsCJ";
- DetailUrl="WorkDetailsCJ.html";
-
- }
- mui.openWindow({
- id: DetailID,
- url: DetailUrl,
- createNew: true,
- show: {
- aniShow: 'pop-in'
- },
- styles: {
- popGesture: 'hide'
- },
- waiting: {
- autoShow: true
- },
- extras: {
- name: id,
- classImport: classImport,
- token: token
- }
- });
- })
-
- // 产品代码
- var Product = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'Department/GetAPPAreaList',
- async: false,
- data: {
- flag: "CPDM",
- token:localStorage.getItem("token")
- },
- dataType: 'json',
- success: function(res) {
- if(res.state.toLowerCase() === "success") {
- res = res.data;
- if(res && res.length > 0) {
- res.forEach(function(v, i) {
- var obj = {};
- obj.id = v.id;
- obj.text = v.text;
- obj.children = v.children;
- Product.push(obj);
- });
- }
- }
- }
- });
- });
- }
|