| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505 |
- 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();
- } else if($(this).val() === "2"){
- $('#complaint').show();
- $('#consult').hide();
- $('#spot').hide();
- $('#kehmm').show();
- $('#qtton').hide();
- }else if($(this).val() === "3"){
- $('#spot').show();
- $('#consult').hide();
- $('#complaint').hide();
- $('#kehmm').show();
- $('#qtton').hide();
- }else if($(this).val() === "4"){
- $('#spot').hide();
- $('#consult').hide();
- $('#complaint').hide();
- $('#kehmm').hide();
- $('#qtton').show();
- }
-
- });
- // 完结不完结切换
- $('.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').attr('data-index');//问题类别
- 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 = '';
- // if($("#catego").val()){
- // cttt = $("#cat").val()+"|"+$("#catego").val();
- // if($("#cate").val()){
- // cttt = $("#cat").val()+"|"+$("#catego").val()+"|"+$("#cate").val();
- // }
- // }
- catt = $("#order_matter").attr('data-index');
- 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').attr('data-index');
- cttt='';
- comdi ='';
- coint='';
- stion='';
- }else if(orderIsover === '4'){
- catt = $('#order_texta').attr('data-index');//问题类别
- 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() {
- typePro();
- // 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',
- 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(), //问题描述
- //咨询模块
- 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_Brand: $('#brand_name').val(),//品牌
- F_MaterialEffect: $('#order_fuhefei').val(),//复合肥肥效
- F_Pipeline: $('#order_chanpinxian').val(),//产品线
- F_Craft: $('#order_gongyi').val(),//工艺
- // F_Formula: $('#enter_formula').val(),//配方
-
-
-
- //抽检模块
- // F_CusName: $('#kxing').val(),//客户姓名
- // F_CusPhone: $('#kdian').val(),//客户电话
- // F_QuestionType:cttt, //问题类别
- F_CJ_Time: $('#order_time').val(),//抽检时间
- F_CJ_Level: $('#order_samplingle').attr('data-index'), //抽检级别
- F_CJ_Unit: $('#order_lingunit').attr('data-index'), //抽检单位
- 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(), //工单类型
-
-
-
- },
- 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;
- console.log(res)
- 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;
- console.log(res)
- 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');
- });
- console.log(renyuaee)
- 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;
- console.log(res)
- 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');
- });
- console.log(rener)
- 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;
- console.log(res)
- 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');
- });
- console.log(viyy)
- 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;
- console.log(res)
- 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);
- });
- console.log(recives)
- // 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;
- console.log(res)
- 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');
- });
- console.log(renyuann)
- 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;
- console.log(res)
- 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');
- });
- console.log(rennn)
- 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;
- console.log(res)
- 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');
- });
- console.log(villl)
- 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;
- console.log(res)
- 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);
- });
- console.log(recive)
- // 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;
- console.log(res)
- 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');
- });
- console.log(renyuan)
- 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;
- console.log(res)
- 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');
- });
- console.log(ren)
- 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;
- console.log(res)
- 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');
- });
- console.log(vil)
- 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 keyLi = [];
- //// 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;
- // keyLi.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;
- console.log(res)
- 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;
- console.log(res)
- 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,
- },
- dataType: 'json',
- success: function(res) {
- if(res.state.toLowerCase() === "success") {
- res = res.data;
- console.log(res)
- 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);
- });
- console.log(lisboa)
- // 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_RegionName: $('#order_macrocell').attr('data-index'),
- },
- dataType: "json",
- async: true,
- success: function(res) {
- if(res.state.toLowerCase() === "success") {
- res = res.data;
- console.log(res)
- 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;
- console.log(res)
- 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;
- console.log(res)
- 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');
- });
- // console.log(more)
- 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;
- console.log(res)
- 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');
- });
- // console.log(vector)
- 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) {
- RCiP.show(function(items) {
- console.log(items[0].text)
- RCResultss.value =items[0].text
- RCResultss.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);
- //市
- 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) {
- RCResultss2.value =items[0].text
- RCResultss2.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);
-
- //区/县
- 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) {
- RCResults22.value =items[0].text
- RCResults22.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);
- //乡
- 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) {
- RCResults33.value =items[0].text
- RCResults33.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);
-
-
-
-
-
-
-
-
-
-
- //销售基地
- 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');
- RCs14.addEventListener('tap', function(event) {
- which();
- since.show(function(items) {
- RCResults14.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) {
- //异常处理;
- }
- })
-
- });
|