| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462 |
- mui.init({})
- var UserCode = helper.cookies.get("usercode");
- var openid = helper.cookies.get("openid");
- var areaID = helper.request.queryString("areaID");
- //var openid = "oXF5e1mWpX5DajW5_yjNLPKb8ThE";
- $(function() {
-
-
- // 投诉咨询切换
- $('.order_type').find('input[type="radio"]').on('change', function() {
- if($(this).val() === "1") { //抽检
- $('#consult').show(); //kehmm qtton
- $('#complaint').hide();
- $('#spot').hide();
- $('#kehmm').hide();
- $('#qtton').hide();
- $('.noSamplTime').show();
- $('.SamplTime').hide();
- $(".overtime input[type=radio][value='12']").prop("checked", true);
- } else if($(this).val() === "2"){
- $('#complaint').show();
- $('#consult').hide();
- $('#spot').hide();
- $('#kehmm').show();
- $('#qtton').hide();
- $('.noSamplTime').show();
- $('.SamplTime').hide();
- $(".overtime input[type=radio][value='12']").prop("checked", true);
- }else if($(this).val() === "3"){
- $('#spot').show();
- $('#consult').hide();
- $('#complaint').hide();
- $('#kehmm').show();
- $('#qtton').hide();
- $('.noSamplTime').hide();
- $('.SamplTime').show();
- $(".overtime input[type=radio][value='720']").prop("checked", true);
- }else if($(this).val() === "4"){
- $('#spot').hide();
- $('#consult').hide();
- $('#complaint').hide();
- $('#kehmm').hide();
- $('#qtton').show();
- $('.noSamplTime').show();
- $('.SamplTime').hide();
- $(".overtime input[type=radio][value='12']").prop("checked", true);
- }
-
- });
- // 完结不完结切换
- $('.wjbwj').find('input[type="radio"]').on('change', function() {
- if($(this).val() === "1") { //投诉
- //receive
- $('#zhipaiyin').hide();
- $('#wanji').show();
- $('#zhipaaa').hide();
- $('#submit').hide();
- } else if($(this).val() === "2"){
- $('#zhipaiyin').show();
- $('#wanji').hide();
- $('#zhipaaa').hide();
- $('#submit').hide();
- }
- });
- // 指派切换
- $('.zhipp').find('input[type="radio"]').on('change', function() {
- if($(this).val() === "3") { //投诉
- //receive
- $('#zhipaaa').show();
- $('#buzp').show();
- $('#submit').hide();
- $('#wanji').hide();
- } else if($(this).val() === "4"){
- $('#zhipaaa').hide();
- $('#buzp').hide();
- $('#submit').show();
- $('#wanji').hide();
- }
- });
- //工单有效性
- $('#order_valid').find('input[type="radio"]').on('change', function() {
- //是否有效工单项(0有效,1无效)
- if($(this).val() === "1") { //无效
- $('.order_note').show();
- } else {
- $('.order_note').hide();
- }
- });
-
- var catt;//问题类别
- var cttt;//投诉问题类别
- var comdi;//产品名称
- var coint; //销售基地
- var stion; //问题数量
- var shengch; //生产批次号
- var jyppai;
- var daqu;
- var fengo;
- var orderIsover;
- function typePro(){
- orderIsover=$('input:radio[name="form"]:checked').val();
- if(orderIsover === '1'){
- // debugger
- catt = $('#order_category').val();//问题类别
- comdi = $('#order_productname').val();//产品名称
- stion = $('#order_Claimnumber').val();//问题数量
- coint=$('#ower_relationship').val();//销售基地
- daqu='';
- fengo='';
- jyppai='';
- cttt='';
- shengch='';
- $('#wlbm').hide();
- $('#wlmcc').hide();
- $('#clie').hide();
- $('#mate').hide();
- }else if(orderIsover=== '2'){
- daqu=$('#order_macrocell').val();
- fengo=$('#order_branch').val();
- jyppai=$('#order_pinpa').val();
- comdi = $('#order_product').val();//产品名称
- cttt = '';
- catt = $("#order_matter").val();
- shengch=$('#order_batch').val();//生产批次号
- stion = $('#order_Claimnumber').val();//问题数量
- coint=$('#ower_Sales_base').val();//销售基地
- }else if(orderIsover === '3'){
- daqu=$('#order_macrocell').val();
- fengo=$('#order_branch').val();
- jyppai=$('#order_pinpai').val();
- shengch=$('#batch_num').val();//生产批次号
- catt = $('#order_wentlb').val();
- cttt='';
- comdi ='';
- coint='';
- stion='';
- }else if(orderIsover === '4'){
- catt = $('#order_texta').val();//问题类别
- comdi = $('#order_chpi').val();//产品名称
- stion = $('#order_wensu').val();//问题数量
- coint=$('#ower_showCpke').val();//销售基地
- daqu='';
- fengo='';
- jyppai='';
- cttt='';
- shengch='';
- $('#wlbm').hide();
- $('#wlmcc').hide();
- $('#clie').hide();
- $('#mate').hide();
- }
- }
-
-
-
- //提交按钮
- $('#submit').on('tap', function() {
- // $(this).attr("disabled","disabled");
- typePro();
- var str_ary = '';
- $(".image-box").each(function (i, n) {
- var a = $(n).attr("indexs");
- if (a) {
- if (str_ary) {
- str_ary = str_ary + ',' + a;
- }
- else {
- str_ary = a;
- }
- }
- })
- // var myreg = /^[1][3,4,5,7,8][0-9]{9}$/;
- var myreg11 = /^(([0\+]\d{2,3}-)?((0\d{2,3}))?(-)?)?(\d{7,8})(-(\d{3,}))?$/;
- var str = $("#order_tel").val();
- if($('#order_name').val() == '') {
- mui.alert('请输入客户姓名!') //请输入工单类型
- } else if($('#order_phone').val() == '') {
- mui.alert('请输入客户电话!') //请输入客户姓名
- }else {
- $.ajax({
- type: "post",
- dataType: 'json',
- url: huayi.config.callcenter_url + 'WxLogin/Add',
- beforeSend: function () {
- // 禁用按钮防止重复提交
- $("#submit").attr({ disabled: "disabled" });
- },
- async: true,
- data: {
- // F_State:0,
- F_WxOpenId: openid, //微信openid,
- F_Source: $('#order_source').attr('data-index'), //工单来源
- F_Type: $('.order_type').find('input[type="radio"]:checked').val(), //工单类型
- //公共字段
- F_CusName: $('#order_name').val(),//客户姓名
- F_CusPhone: $('#order_phone').val(),//客户电话
- F_CompanyName: $('#order_tel').val(),//公司名称
- F_IncidentProvince:$("#choworder_rengin").attr('data-index'), //省
- F_IncidentCity: $("#shouorder_shi").attr('data-index'), //市
- F_IncidentCountry:$("#chouorder_xian").attr('data-index'), //县
- F_IncidentTownship: $("#chouorder_xiang").attr('data-index'), //乡
- F_IncidentDetailed: $("#choworder_tower").val(), //详细地址
- F_Description:$("#order_reception").val(), //问题描述
- overtime:$('.overtime').find('input[type="radio"]:checked').val(),//超期时间
- sms:$('.sms').find('input[type="radio"]:checked').val(),//是否发送短信
- //咨询模块
- F_QuestionType:catt,//问题类别
- F_TS_Category: comdi,//产品名称
- F_ZX_Quantity:stion,//问题数量
- F_SalesBase:coint,//销售基地
- //投诉模块
- F_BatchNumber:shengch,//生产批号
- // F_TS_Formula: $('#formula').val(),//配方
- F_TS_Quantity:$("#order_Claimnu").val(), //问题数量 order_Claimnumber
- // F_TS_Level: $('#order_rank').val(),//重要界别
- F_SalesPhone: $('#telephone').val(),//电话
- F_ZX_Area: daqu,//大区
- F_ZX_Branch:fengo,//分公司
- F_Brand: jyppai,//经营品牌
- F_Salesman: $('#order_yewu').val(),//业务员
- F_MaterialID: $('#order_material').val(),//物料编码
- F_CustomerID: $('#order_coding').val(),//客户编号
- F_Model: $('#order_xinghao').val(),//型号
- F_Specs: $('#order_guige').val(),//规格
- F_Level1: $('#order_yiji').val(),//一级分类
- F_Level2: $('#order_erji').val(),//二级分类
- F_Level3: $('#order_sanji').val(),//三级分类
- F_MaterialEffect: $('#order_fuhefei').val(),//复合肥肥效
- F_Pipeline: $('#order_chanpinxian').val(),//产品线
- F_Craft: $('#order_gongyi').val(),//工艺
-
-
-
- //抽检模块
- F_CJ_Time: $('#order_time').val(),//抽检时间
- F_CJ_Level: $('#order_samplingle').val(), //抽检级别
- F_CJ_Unit: $('#order_lingunit').val(), //抽检单位
- F_CJ_TestUnit: $('#order_assay').val(),//化验单位
- F_CJ_Tonnage: $('#order_tunnage').val(),//抽检吨数
- F_CJ_BagNo: $('#order_algebra').val(),//抽检袋数
- F_CJ_Outlay: $('#order_money').val(),//公关费用金额
- // F_Source: $('#order_source').attr('data-index'), //工单来源
- // F_Type: $('.order_type').find('input[type="radio"]:checked').val(), //工单类型
- F_Files:str_ary
- },
- success: function(data) {
- if(data.state == "success") {
- debugger
- //alert($('#order_reception').val()), //描述详情
- mui.toast('创建成功');
- window.location.href = "Have_list.html";
- } else {
- mui.toast(data.message);
- }
- }
- });
- }
- })
- function getDepts() {}
- // 投诉省市县乡
-
- var recivesww = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
- async: false,
- data: {
- F_Layer: 1,
- F_RegionName: $('#touorder_rengin').attr('data-index'),
- },
- 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.value = v.F_RegionId;
- obj.text = v.F_RegionName;
- recivesww.push(obj);
- });
- console.log(recivesww)
- // cityPicker5.setData(recive);
- }
- }
-
- //recive = res.data;
- //console.log(recive)
- //alert(JSON.stringify(data));
- }
- });
- function getRecect(){
- var renyuaee = []
- $.ajax({
- url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
- type: 'get',
- data: {
- F_Layer: 2,
- F_RegionName: $('#touorder_rengin').attr('data-index'),
- },
- dataType: "json",
- async: true,
- success: function(res) {
- if(res.state.toLowerCase() === "success") {
- res = res.data;
- if(res && res.length >0) {
- res.forEach(function(v, i) {
- var obj = {};
- obj.value = v.F_RegionId;
- obj.text = v.F_RegionName;
- renyuaee.push(obj);
- //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
- });
- RCiPickee2.setData(renyuaee);
- }
- }
- },
- });
- }
- //区县
- function getRtt(){
- var rener = []
- $.ajax({
- url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
- type: 'get',
- data: {
- F_Layer:3,
- F_RegionName: $('#touorder_shi').attr('data-index'),
- },
- dataType: "json",
- async: true,
- success: function(res) {
- if(res.state.toLowerCase() === "success") {
- res = res.data;
- if(res && res.length >0) {
- res.forEach(function(v, i) {
- var obj = {};
- obj.value = v.F_RegionId;
- obj.text = v.F_RegionName;
- rener.push(obj);
- //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
- });
- RCiPic2.setData(rener);
- }
- }
- },
- });
- }
- //乡
- function villagoo(){
- var viyy = []
- $.ajax({
- url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
- type: 'get',
- data: {
- F_Layer:4,
- F_RegionName: $('#touorder_xian').attr('data-index'),
- },
- dataType: "json",
- async: true,
- success: function(res) {
- if(res.state.toLowerCase() === "success") {
- res = res.data;
- if(res && res.length >0) {
- res.forEach(function(v, i) {
- var obj = {};
- obj.value = v.F_RegionId;
- obj.text = v.F_RegionName;
- viyy.push(obj);
- //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
- });
- RCimm.setData(viyy);
- }
- }
- },
- });
- }
-
-
- // 咨询省市县乡
-
- var recives = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
- async: false,
- data: {
- F_Layer: 1,
- F_RegionName: $('#choworder_rengin').attr('data-index'),
- },
- 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.value = v.F_RegionId;
- obj.text = v.F_RegionName;
- recives.push(obj);
- });
- // cityPicker5.setData(recive);
- }
- }
-
- //recive = res.data;
- //console.log(recive)
- //alert(JSON.stringify(data));
- }
- });
- //市
- function getRece(){
- var renyuann = []
- $.ajax({
- url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
- type: 'get',
- data: {
- F_Layer: 2,
- F_RegionName: $('#choworder_rengin').attr('data-index'),
- },
- dataType: "json",
- async: true,
- success: function(res) {
- if(res.state.toLowerCase() === "success") {
- res = res.data;
- if(res && res.length >0) {
- res.forEach(function(v, i) {
- var obj = {};
- obj.value = v.F_RegionId;
- obj.text = v.F_RegionName;
- renyuann.push(obj);
- //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
- });
- RCiPickee1.setData(renyuann);
- }
- }
- },
- });
- }
- //区/县
- function getReee(){
- var rennn = []
- $.ajax({
- url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
- type: 'get',
- data: {
- F_Layer:3,
- F_RegionName: $('#shouorder_shi').attr('data-index'),
- },
- dataType: "json",
- async: true,
- success: function(res) {
- if(res.state.toLowerCase() === "success") {
- res = res.data;
- if(res && res.length >0) {
- res.forEach(function(v, i) {
- var obj = {};
- obj.value = v.F_RegionId;
- obj.text = v.F_RegionName;
- rennn.push(obj);
- //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
- });
- RCiPi1.setData(rennn);
- }
- }
- },
- });
- }
- //乡
- function villagee(){
- var villl = []
- $.ajax({
- url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
- type: 'get',
- data: {
- F_Layer:4,
- F_RegionName: $('#chouorder_xian').attr('data-index'),
- },
- dataType: "json",
- async: true,
- success: function(res) {
- if(res.state.toLowerCase() === "success") {
- res = res.data;
- if(res && res.length >0) {
- res.forEach(function(v, i) {
- var obj = {};
- obj.value = v.F_RegionId;
- obj.text = v.F_RegionName;
- villl.push(obj);
- //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
- });
- RCi12.setData(villl);
- }
- }
- },
- });
- }
- //投诉省市县乡
- // 省
-
- var recive = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
- async: false,
- data: {
- F_Layer: 1,
- F_RegionName: $('#order_rengin').attr('data-index'),
- },
- 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.value = v.F_RegionId;
- obj.text = v.F_RegionName;
- recive.push(obj);
- });
- // cityPicker5.setData(recive);
- }
- }
-
- //recive = res.data;
- //console.log(recive)
- //alert(JSON.stringify(data));
- }
- });
- //市
- function getReceiveUser(){
- var renyuan = []
- $.ajax({
- url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
- type: 'get',
- data: {
- F_Layer: 2,
- F_RegionName: $('#order_rengin').attr('data-index'),
- },
- dataType: "json",
- async: true,
- success: function(res) {
- if(res.state.toLowerCase() === "success") {
- res = res.data;
- if(res && res.length >0) {
- res.forEach(function(v, i) {
- var obj = {};
- obj.value = v.F_RegionId;
- obj.text = v.F_RegionName;
- renyuan.push(obj);
- //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
- });
- RCiPicke.setData(renyuan);
- }
- }
- },
- });
- }
- //区/县
- function getRe(){
- var ren = []
- $.ajax({
- url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
- type: 'get',
- data: {
- F_Layer:3,
- F_RegionName: $('#order_shi').attr('data-index'),
- },
- dataType: "json",
- async: true,
- success: function(res) {
- if(res.state.toLowerCase() === "success") {
- res = res.data;
- if(res && res.length >0) {
- res.forEach(function(v, i) {
- var obj = {};
- obj.value = v.F_RegionId;
- obj.text = v.F_RegionName;
- ren.push(obj);
- //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
- });
- RCiPi.setData(ren);
- }
- }
- },
- });
- }
- //乡
- function village(){
- var vil = []
- $.ajax({
- url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
- type: 'get',
- data: {
- F_Layer:4,
- F_RegionName: $('#order_xian').attr('data-index'),
- },
- dataType: "json",
- async: true,
- success: function(res) {
- if(res.state.toLowerCase() === "success") {
- res = res.data;
- if(res && res.length >0) {
- res.forEach(function(v, i) {
- var obj = {};
- obj.value = v.F_RegionId;
- obj.text = v.F_RegionName;
- vil.push(obj);
- //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
- });
- RCi.setData(vil);
- }
- }
- },
- });
- }
- //获取上一级
- Ajax();
- function Ajax() {
- $.ajax({
- url: huayi.config.callcenter_url + 'WxLogin/GetDpment',
- data: {
- OpenId: openid, //微信openid,
- },
- async: true,
- dataType: 'json',
- type: 'get', //HTTP请求类型
- success: function(data) {
- if(data.state.toLowerCase() == "success") {
- var result = data.data;
- $("#custo").text(result.F_UserName);
- $("#cus").text(result.F_UserCode);
-
-
- }
- },
- error: function(xhr, type, errorThrown) {
- //异常处理;
- }
- })
- }
- //销售基地
- var keyList = [];
- // console.log(keyList);
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
- async: false,
- data: {
- flag: 'XSJD'
- },
- dataType: 'json',
- success: function(data) {
- var key_data = data.data;
- // console.log(data.data);
- $(key_data).each(function(i, n) {
- var obj = {};
- obj.value = n.F_DictionaryValueId;
- obj.text = n.F_Name;
- keyList.push(obj)
- })
- }
- });
- //问题类别
- var ke = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'WorkOrder/GetQuestionNameType',
- async: false,
- data: {
- type:3,
- },
- 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.value = v.id;
- obj.text = v.text;
- ke.push(obj);
- });
-
- // cityPicker5.setData(recive);
- }
- }
- }
- });
- //抽检问题类别
- var kees = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'WorkOrder/GetQuestionNameType',
- async: false,
- data: {
- type:2,
- },
- 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.value = v.id;
- obj.text = v.text;
- kees.push(obj);
- });
-
- // cityPicker5.setData(recive);
- }
- }
- }
- });
- //产品名称
- var keee = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
- async: false,
- data: {
- flag: 'CPZL'
- },
- dataType: 'json',
- success: function(data) {
- var key_data = data.data;
- // console.log(key_data);
- $(key_data).each(function(i, n) {
- var obj = {};
- obj.value = n.F_DictionaryValueId;
- obj.text = n.F_Name;
- keee.push(obj)
- // console.log(ke);
- })
- }
- });
- //投诉产品名称
- var letter = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
- async: false,
- data: {
- flag: 'CPZL'
- },
- dataType: 'json',
- success: function(data) {
- var key_data = data.data;
- $(key_data).each(function(i, n) {
- var obj = {};
- obj.value = n.F_DictionaryValueId;
- obj.text = n.F_Name;
- letter.push(obj)
- })
- }
- });
- //投诉重要级别
- var rank = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
- async: false,
- data: {
- flag: 'ZYJB'
- },
- dataType: 'json',
- success: function(data) {
- var key_data = data.data;
- // console.log(key_data);
- $(key_data).each(function(i, n) {
- var obj = {};
- obj.value = n.F_DictionaryValueId;
- obj.text = n.F_Name;
- rank.push(obj)
- // console.log(ke);
- })
- }
- });
- //抽检抽检级别
- var check = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
- async: false,
- data: {
- flag: 'CJJP'
- },
- dataType: 'json',
- success: function(data) {
- var key_data = data.data;
- // console.log(key_data);
- $(key_data).each(function(i, n) {
- var obj = {};
- obj.value = n.F_DictionaryValueId;
- obj.text = n.F_Name;
- check.push(obj)
- })
- }
- });
- //抽检抽检单位
- var monad = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
- async: false,
- data: {
- flag: 'CJDW'
- },
- dataType: 'json',
- success: function(data) {
- var key_data = data.data;
- // console.log(key_data);
- $(key_data).each(function(i, n) {
- var obj = {};
- obj.value = n.F_DictionaryValueId;
- obj.text = n.F_Name;
- monad.push(obj)
- })
- }
- });
- //大区
- var lisboa = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'Department/GetList',
- async: false,
- data: {
- F_Layer: 1,
- F_DeptName: $('#order_macrocell').attr('data-index'),
- },
- 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.value = v.F_DeptId;
- obj.text = v.F_DeptName;
- lisboa.push(obj);
- });
- // cityPicker5.setData(recive);
- }
- }
-
- //recive = res.data;
- //console.log(recive)
- //alert(JSON.stringify(data));
- }
- });
-
-
- //分公司
- function fengong(){
- var filiale = []
- $.ajax({
- url: huayi.config.callcenter_url + 'Department/GetList',
- type: 'get',
- data: {
- F_Layer:2,
- F_DeptName: $('#order_macrocell').attr('data-index'),
- },
- dataType: "json",
- async: true,
- success: function(res) {
- if(res.state.toLowerCase() === "success") {
- res = res.data;
- if(res && res.length >0) {
- res.forEach(function(v, i) {
- var obj = {};
- obj.value = v.F_DeptId;
- obj.text = v.F_DeptName;
- filiale.push(obj);
- //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
- });
- // console.log(vil)
- company.setData(filiale);
- }
- }
- },
- });
- }
- //投诉问题类别1
- var complaints = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'WorkOrder/GetQuestionNameType',
- async: false,
- data: {
- type:1,
- },
- 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.value = v.id;
- obj.text = v.text;
- complaints.push(obj);
- });
-
- // cityPicker5.setData(recive);
- }
- }
-
- //recive = res.data;
- //console.log(recive)
- //alert(JSON.stringify(data));
- }
- });
- //投诉问题类别2
- function range(){
- var more = []
- $.ajax({
- url: huayi.config.callcenter_url + 'WorkOrder/GetQuestionNameType',
- type: 'get',
- data: {
- QuestionName:$('#order_cat').val(),
- type:1,
- },
- dataType: "json",
- async: true,
- success: function(res) {
- if(res.state.toLowerCase() === "success") {
- res = res.data;
- if(res && res.length >0) {
- res.forEach(function(v, i) {
- var obj = {};
- obj.value = v.id;
- obj.text = v.text;
- more .push(obj);
- // $('<option value="' + v.id + '">' + v.text + '</option>').appendTo('#order_recive');
- });
- com.setData(more);
- }
- }
- },
- });
- }
- //投诉问题类别3
- function which(){
- var vector = []
- $.ajax({
- url: huayi.config.callcenter_url + 'WorkOrder/GetQuestionNameType',
- type: 'get',
- data: {
- QuestionName:$('#order_question').val(),
- type:1,
- },
- dataType: "json",
- async: true,
- success: function(res) {
- if(res.state.toLowerCase() === "success") {
- res = res.data;
- if(res && res.length >0) {
- res.forEach(function(v, i) {
- var obj = {};
- obj.value = v.id;
- obj.text = v.text;
- vector .push(obj);
- // $('<option value="' + v.id + '">' + v.text + '</option>').appendTo('#order_recive');
- });
- since.setData(vector);
- }
- }
- },
- });
- }
-
-
- (function($, doc) {
- $.init();
- $.ready(function() {
- // 咨询 省
- var RCiP = new $.PopPicker({
- F_Layer: 1,
- });
- RCiP.setData(recives);
- var RCss1 = doc.getElementById('chouhuTi');
- var RCResultss = doc.getElementById('choworder_rengin');
- RCss1.addEventListener('tap', function(event) {
- doc.getElementById('shouorder_shi').value="";
- doc.getElementById('chouorder_xian').value="";
- doc.getElementById('chouorder_xiang').value="";
- RCiP.show(function(items) {
- console.log(items[0].text)
- RCResultss.value =items[0].text
- RCResultss.setAttribute("data-index", items[0].text);
- });
- }, false);
- //市
- RCiPickee1 = new $.PopPicker({
- F_Layer: 1,
- });
- var RCss2 = doc.getElementById('chowZhuTiPicker');
- var RCResultss2 = doc.getElementById('shouorder_shi');
- RCss2.addEventListener('tap', function(event) {
- getRece();
- RCiPickee1.show(function(items) {
- doc.getElementById('chouorder_xian').value="";
- doc.getElementById('chouorder_xiang').value="";
- if (items[0].text!=undefined) {
- RCResultss2.value =items[0].text
- RCResultss2.setAttribute("data-index", items[0].text);
- }
- });
- }, false);
-
- //区/县
- RCiPi1 = new $.PopPicker({
- F_Layer: 1,
- });
- var RCs22 = doc.getElementById('chowcounty');
- var RCResults22 = doc.getElementById('chouorder_xian');
- RCs22.addEventListener('tap', function(event) {
- getReee();
- RCiPi1.show(function(items) {
- doc.getElementById('chouorder_xiang').value="";
- if (items[0].text!=undefined) {
- RCResults22.value =items[0].text
- RCResults22.setAttribute("data-index", items[0].text);
- }
- });
- }, false);
- //乡
- RCi12 = new $.PopPicker({
- F_Layer: 1,
- });
- var RCs33= doc.getElementById('chowtowns');
- var RCResults33 = doc.getElementById('chouorder_xiang');
- RCs33.addEventListener('tap', function(event) {
- villagee();
- RCi12.show(function(items) {
- if (items[0].text!=undefined) {
- RCResults33.value =items[0].text
- RCResults33.setAttribute("data-index", items[0].text);
- }
- });
- }, false);
-
-
-
-
-
-
-
-
-
-
- //销售基地
- var cityPicker3 = new $.PopPicker();
- cityPicker3.setData(keyList);
- var showCityPickerButton = doc.getElementById('showCityPicker3');
- var cityResult3 = doc.getElementById('ower_relationship');
- showCityPickerButton.addEventListener('tap', function(event) {
- cityPicker3.show(function(items) {
- cityResult3.value = items[0].text;
- cityResult3.setAttribute("data-index", items[0].value);
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- //其他销售基地
- var cityPicker9 = new $.PopPicker();
- cityPicker9.setData(keyList);
- var showCityPickerButton9 = doc.getElementById('showCpke');
- var cityResult9 = doc.getElementById('ower_showCpke');
- showCityPickerButton9.addEventListener('tap', function(event) {
- cityPicker9.show(function(items) {
- cityResult9.value = items[0].text;
- cityResult9.setAttribute("data-index", items[0].value);
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- //投诉销售基地
- var cityPicker4 = new $.PopPicker();
- cityPicker4.setData(keyList);
- var showCityPickerButton4 = doc.getElementById('Sales_base');
- var cityResult4 = doc.getElementById('ower_Sales_base');
- showCityPickerButton4.addEventListener('tap', function(event) {
- cityPicker3.show(function(items) {
- cityResult4.value = items[0].text;
- cityResult4.setAttribute("data-index", items[0].value);
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- //问题类别
- var city = new $.PopPicker();
- city.setData(ke);
- var showCityPickerButton = doc.getElementById('question');
- var cityResult = doc.getElementById('order_category');
- showCityPickerButton.addEventListener('tap', function(event) {
- city.show(function(items) {
- cityResult.value = items[0].text;
- cityResult.setAttribute("data-index", items[0].value);
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- //抽检问题类别
- var cityes = new $.PopPicker();
- cityes.setData(kees);
- var showCityPickerButton6 = doc.getElementById('wentilb');
- var cityResult6 = doc.getElementById('order_wentlb');
- showCityPickerButton6.addEventListener('tap', function(event) {
- cityes.show(function(items) {
- cityResult6.value = items[0].text;
- cityResult6.setAttribute("data-index", items[0].value);
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- //其他问题类别
- var citytt = new $.PopPicker();
- citytt.setData(ke);
- var showCityPickerButton7 = doc.getElementById('texta');
- var cityResult7 = doc.getElementById('order_texta');
- showCityPickerButton7.addEventListener('tap', function(event) {
- citytt.show(function(items) {
- cityResult7.value = items[0].text;
- cityResult7.setAttribute("data-index", items[0].value);
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- // //游客渠道类型
- // var citye = new $.PopPicker();
- // citye.setData(annel);
- // var showCityPickerButt = doc.getElementById('trench');
- // var cityResultion = doc.getElementById('manager');
- // showCityPickerButt.addEventListener('tap', function(event) {
- // citye.show(function(items) {
- // cityResultion.value = items[0].text;
- // cityResultion.setAttribute("data-index", items[0].value);
- // //返回 false 可以阻止选择框的关闭
- // //return false;
- // });
- // }, false);
- //产品名称
- var cityc = new $.PopPicker();
- cityc.setData(keee);
- var showCityPickerButton1 = doc.getElementById('product');
- var cityResultc1 = doc.getElementById('order_productname');
- showCityPickerButton1.addEventListener('tap', function(event) {
- cityc.show(function(items) {
- cityResultc1.value = items[0].text;
- cityResultc1.setAttribute("data-index", items[0].value);
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- //其他产品名称
- var citycea = new $.PopPicker();
- citycea.setData(keee);
- var showCityPickerButton8 = doc.getElementById('chpi');
- var cityResultc8 = doc.getElementById('order_chpi');
- showCityPickerButton8.addEventListener('tap', function(event) {
- citycea.show(function(items) {
- cityResultc8.value = items[0].text;
- cityResultc8.setAttribute("data-index", items[0].value);
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
-
- //投诉产品名称
- var lett = new $.PopPicker();
- lett.setData(letter);
- var showCityPickerButton2 = doc.getElementById('produ');
- var cityResultc2 = doc.getElementById('order_product');
- showCityPickerButton2.addEventListener('tap', function(event) {
- lett.show(function(items) {
- cityResultc2.value = items[0].text;
- cityResultc2.setAttribute("data-index", items[0].value);
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- // //投诉重要级别
- // var level = new $.PopPicker();
- // level.setData(rank);
- // var showCityPickerButton3 = doc.getElementById('rank');
- // var cityResultc3 = doc.getElementById('order_rank');
- // showCityPickerButton3.addEventListener('tap', function(event) {
- // level.show(function(items) {
- // cityResultc3.value = items[0].text;
- // cityResultc3.setAttribute("data-index", items[0].value);
- // //返回 false 可以阻止选择框的关闭
- // //return false;
- // });
- // }, false);
- //抽检抽检级别
- var spott = new $.PopPicker();
- spott.setData(check);
- var showCityPickerButton4 = doc.getElementById('samp');
- var cityResultc4 = doc.getElementById('order_samplingle');
- showCityPickerButton4.addEventListener('tap', function(event) {
- spott.show(function(items) {
- cityResultc4.value = items[0].text;
- cityResultc4.setAttribute("data-index", items[0].value);
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- //抽检抽检单位
- var unit = new $.PopPicker();
- unit.setData(monad);
- var showCityPick5 = doc.getElementById('ling');
- var cityResultc5 = doc.getElementById('order_lingunit');
- showCityPick5.addEventListener('tap', function(event) {
- unit.show(function(items) {
- cityResultc5.value = items[0].text;
- cityResultc5.setAttribute("data-index", items[0].value);
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
-
- var manager = new $.PopPicker({
- F_Layer: 1,
- });
- manager.setData(lisboa);
- var RCs5 = doc.getElementById('qregion');
- var RCResults5 = doc.getElementById('order_macrocell');
- RCs5.addEventListener('tap', function(event) {
- manager.show(function(items) {
- console.log(items[0].text)
- RCResults5.value =items[0].text
- RCResults5.setAttribute("data-index", items[0].text);
- //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
- //RCResults.setAttribute("data-index", items[0].id);
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- //分公司
- company = new $.PopPicker({
- F_Layer: 2,
- });
- var RCs4 = doc.getElementById('filial');
- var RCResults8 = doc.getElementById('order_branch');
- RCs4.addEventListener('tap', function(event) {
- fengong();
- company.show(function(items) {
- RCResults8.value =items[0].text
- RCResults8.setAttribute("data-index", items[0].text);
- //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
- //RCResults.setAttribute("data-index", items[0].id);
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- //投诉问题类别1
- var complai = new $.PopPicker({
- pid:0,
- });
- complai.setData(complaints);
- var RCs12 = doc.getElementById('quest');
- var RCResults12 = doc.getElementById('order_cat');
- RCs12.addEventListener('tap', function(event) {
- complai.show(function(items) {
- console.log(items[0].text)
- RCResults12.value =items[0].text
- RCResults12.setAttribute("data-index", items[0].value);
- //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
- //RCResults.setAttribute("data-index", items[0].id);
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- //问题类别2
- com = new $.PopPicker({
- pid:1,
- });
- console.log()
- var RCs13= doc.getElementById('que');
- var RCResults13 = doc.getElementById('order_question');
- RCs13.addEventListener('tap', function(event) {
- range();
- com.show(function(items) {
- RCResults13.value =items[0].text
- RCResults13.setAttribute("data-index", items[0].value);
- //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
- //RCResults.setAttribute("data-index", items[0].id);
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- //问题类别3
- since = new $.PopPicker({
- pid:1,
- });
- var RCs14= doc.getElementById('matter');
- var RCResults14 = doc.getElementById('order_matter');
- var RCResults144 = doc.getElementById('order_prer');
- RCs14.addEventListener('tap', function(event) {
- which();
- since.show(function(items) {
- RCResults144.value =items[0].text
- RCResults14.setAttribute("data-index", items[0].value);
- //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
- //RCResults.setAttribute("data-index", items[0].id);
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
-
-
-
-
- })
- })(mui, document);
- })
- $("#order_productname").click(function(){
-
- })
- $('#order_productname').find('input[data-index=""]').on('change', function() {
- if($(this).val() == "624") { //业务办理
- $('#qtqcr').show();
- }else{
- $('#qtqcr').hide();
- }
- });
- $('#order_coding').blur(function () {
- // alert($(this).val());
- // $('#material').show();
- if($(this).val()==''){
- $('#tianxie').show();
- $('#xiangqingm').hide();
- }else {
- $('#tianxie').hide();
- $('#xiangqingm').show();
-
- }
- //根据客户编号获取信息
- $.ajax({
- url: huayi.config.callcenter_url + 'CustomerNew/GetCodeCustomer',
- data: {
- code:$('#order_coding').val(),
- OpenId: openid, //微信openid,
- },
- async: true,
- dataType: 'json',
- type: 'get', //HTTP请求类型
- success: function(data) {
- if(data.state.toLowerCase() == "success") {
- var result = data.data;
-
- $('#order_yewu').val(result.F_Salesman);
- $('#order_yewuphone').val(result.F_SalesPhone);
- $('#order_macrocell').val(result.F_AreaName);
- $('#order_branch').val(result.F_BranchName);
- $('#order_pinpai').val(result.F_Brands);
- }
- },
- error: function(xhr, type, errorThrown) {
- //异常处理;
- }
- })
-
- });
- $('#order_material').blur(function () {
- // alert($(this).val());
- // $('#material').show();
- if($(this).val()==''){
- $('#wuliaotian').show();
- $('#wuliao').hide();
- }else {
- $('#wuliaotian').hide();
- $('#wuliao').show();
-
- }
- //根据物料编码获取信息
- $.ajax({
- url: huayi.config.callcenter_url + 'MaterialManage/GetCodeModel',
- data: {
- code:$('#order_material').val(),
- OpenId: openid, //微信openid,
- },
- async: true,
- dataType: 'json',
- type: 'get', //
- success: function(data) {
- if(data.state.toLowerCase() == "success") {
- var result = data.data;
- $("#order_mingcheng").val(result.model.F_MaterialName);//物料名称
- $("#order_xinghao").val(result.model.F_Model),//型号
- $("#order_guige").val(result.model.F_Specs);//规格
- $("#order_yiji").val(result.model.F_Level1);//一级分类
- $("#order_erji").val(result.model.F_Level2);//二级分类
- $("#order_sanji").val(result.model.F_Level3);//三级分类
- $('#order_pinpa').val(result.model.F_Brand);//品牌
- $('#order_fuhefei').val(result.model.F_MaterialEffect); //复合肥肥效
- $('#order_chanpinxian').val(result.model.F_Pipeline); //产品线tensions
- $("#order_gongyi").val(result.model.F_Craft);//工艺
- }
- },
- error: function(xhr, type, errorThrown) {
- //异常处理;
- }
- })
-
- });
|