| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500 |
- 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(); //receive
- $('#complaint').hide();
- $('#spot').hide();
- } else if($(this).val() === "2"){
- $('#complaint').show();
- $('#consult').hide();
- $('#spot').hide();
- }else if($(this).val() === "3"){
- $('#spot').show();
- $('#consult').hide();
- $('#complaint').hide();
- }
- });
- // 完结不完结切换
- $('.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();
- }
- });
- //提交按钮
- $('#submit').on('tap', function() {
- // 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 if($('#order_tel').val() == '') {
- mui.alert('请输入公司名称!') //请输入客户姓名
- } else {
- $.ajax({
- type: "post",
- dataType: 'json',
- url: huayi.config.callcenter_url + '/WxLogin/Add',
- async: true,
- data: {
- F_Source: $('#order_source').attr('data-index'), //工单来源
- F_Type: $('.order_type').find('input[type="radio"]:checked').val(), //工单类型
- // 咨询模块
- F_AddressFull: $("#order_category").attr('data-index'), //问题类别
- F_TS_Category: $("#order_productname").attr('data-index'), //产品名称
- F_TS_Category: $("#order_qita").val(), //其他输入
- F_ZX_Quantity: $("#order_Claimnumber").val(), //咨询数量
- F_ZX_Area: $("#order_macrocell").attr('data-index'), //大区
- F_ZX_Branch: $("#order_branch").attr('data-index'), //分公司
- 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_CustomerID: $("#order_coding").val(), //客户编码
- F_MaterialID: $("#order_material").val(), //物料编码
- F_QuestionType: $("#order_cate").attr('data-index'), //问题类别
- F_QuestionType: $("#order_category").attr('data-index'), //问题类别
- F_BatchNumber: $("#order_batch").val(), //生产批号
- F_TS_Formula: $("#order_recipe").val(), //配方
- F_TS_Category: $("#order_productname").attr('data-index'), //产品名称
- F_TS_Category: $("#order_qi").val(), //其他输入
- F_TS_Quantity: $("#order_Claimnumber").val(), //问题数量
- F_TS_Level: $("#order_rank").attr('data-index'), //重要级别
- //抽检模块
- F_QuestionType: $("#order_response").attr('data-index'), //问题类别
- F_CustomerID: $("#order_coding").val(), //客户编码
- F_MaterialID: $("#order_material").val(), //物料编码
- F_CJ_Time: $("#order_time").val(), //抽检时间
- F_QuestionType: $("#order_response").attr('data-index'), //问题类别
- 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_CusName: $('#order_name').val(), //客户姓名
- F_CusPhone: $('#order_phone').val(), //否 string 客户电话
- F_CompanyName: $("#order_tel").val(), //公司名称
- //
- F_IncidentDetailed: $("#order_tower").val(), //详细地址
- F_SalesBase: $("#ower_relationship").attr('data-index'), //销售基地
- F_Description: $("#order_reception").val(), //问题描述
- F_WxOpenId: openid, //微信openid,
- // "token": $.cookie("token")
- // iseffective: $('#order_valid').find('input[type="radio"]:checked').val(), // 否 int 是否有效工单项(0有效,1无效)
- // note: $('#order_note').val(), // 无效原因 否 string 备注 (iseffective,1无效时填写备注)
- // clbm: $('#recive_type').attr('data-index'), //否 int 咨询类工单指派部门id
- // clid: $('#ower_recive').attr('data-index'), // 否 string 接收人id $(this)
- //$('#order_receiveUser option').find("option:selected").val(),
-
- },
- success: function(data) {
- if(data.state == "success") {
- debugger
- //alert($('#order_reception').val()), //描述详情
- mui.toast('创建成功');
- $('#order_type').val(''); //工单类型
- $('#order_name').val(''), //客户姓名
- $('#order_tel').val(''), //否 string 联系电话
- $("#order_rengin").attr(''), //区域名称
- $("#order_pro").attr(''), //项目名称
- $("#order_floor").attr(''), //楼号
- $('#order_room').val(''), //房间号
- $('#ower_relationship').attr(''), //房东关系
- $('#order_response').find('input[type="radio"]:checked').val(), //否 int 客户反应
- $('#complaintOrder_type').attr(''), //否 int 处理部门(投诉类型)
- $('#serviceOrder_type').attr(''), //否int 客服类类型
- $('#is_quality_assurance').attr(''), //否 int 是,//否过质保
- //$('#order_reception').val(''), //描述详情
- $('#order_responsible').val(''), //否 string 受理人
- $('#order_valid').find('input[type="radio"]:checked').val(), // 否 int 是否有效工单项(0有效,1无效)
- $('#order_note').val(''), // 无效原因 否 string 备注 (iseffective,1无效时填写备注)
- $('#recive_type').attr(''), //$('#order_transfer_dept').attr('data-id') 否 int 咨询类工单指派部门id
- $('#ower_recive').attr(''), // 否 string 接收人id $(this)
- 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 ke = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
- async: false,
- data: {
- flag: 'ZXWTLB',
- type:3,
- },
- 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;
- ke.push(obj)
- })
- }
- });
- //产品名称
- 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_RegionName: $('#order_macrocell').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_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,
- QuestionName:$('#order_cat').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.id;
- obj.text = v.text;
- complaints.push(obj);
- });
- console.log(lisboa)
- // 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').attr('data-index'),
- 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.F_UserId + '">' + v.F_UserName + '</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').attr('data-index'),
- 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.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
- });
- // console.log(vector)
- since.setData(vector);
- }
- }
- },
- });
- }
-
-
- (function($, doc) {
- $.init();
- $.ready(function() {
-
-
-
- //接收部门
- // var Rickers1 = new $.PopPicker({
- // layer: 2
- // });
- // Rickers1.setData(recccc);
- // var RCs = doc.getElementById('showUserPicker1');
- // var sults1 = doc.getElementById('recive_type');
- // var sults2 = doc.getElementById('recive_type1');
- // var sults3 = doc.getElementById('recive_type2');
- // RCs.addEventListener('tap', function(event) {
- // Rickers1.show(function(items) {
- // console.log(items)
- // if(items[1].text == undefined) {
- // sults1.value = items[0].text;
- // sults1.setAttribute("data-index", items[0].id);
- // } else {
- // sults1.value = items[1].text
- // sults1.setAttribute("data-index", items[1].id);
- // }
- // //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
- // //RCResults.setAttribute("data-index", items[0].id);
- // //RCResults2.setAttribute("data-index", items[1].id);
- // //RCResults3.setAttribute("data-index", items[2].id);
- // //返回 false 可以阻止选择框的关闭
- // //return false;
- // });
- // }, false);
- // 接收人员
- // city5 = new $.PopPicker();
- // var showCityPickerButton5 = doc.getElementById('showCityPicker5');
- // var cityt5 = doc.getElementById('ower_recive');
- // showCityPickerButton5.addEventListener('tap', function(event) {
- // geveUser();
- // city5.show(function(items) {
- // if (items[0].text!=undefined) {
- // cityt5.value = items[0].text;
- // cityt5.setAttribute("data-index", items[0].value);
- // }
- //
- // //返回 false 可以阻止选择框的关闭
- // //return false;
- // });
- // }, false);
- // 投诉省
- var RCiPp = new $.PopPicker({
- F_Layer: 1,
- });
- RCiPp.setData(recivesww);
- var RCss12 = doc.getElementById('touhuTi');
- var RCResultss1 = doc.getElementById('touorder_rengin');
- RCss12.addEventListener('tap', function(event) {
- RCiPp.show(function(items) {
- console.log(items[0].text)
- RCResultss1.value =items[0].text
- RCResultss1.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);
- //市
- RCiPickee2 = new $.PopPicker({
- F_Layer: 1,
- });
-
- var RCss22 = doc.getElementById('touZhuTiPicker');
- var RCResultss22 = doc.getElementById('touorder_shi');
- RCss22.addEventListener('tap', function(event) {
- getRecect();
- RCiPickee2.show(function(items) {
- RCResultss22.value =items[0].text
- RCResultss22.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);
- RCiPic2 = new $.PopPicker({
- F_Layer: 1,
- });
-
- var RCss33 = doc.getElementById('toucounty');
- var RCResultss33 = doc.getElementById('touorder_xian');
- RCss33.addEventListener('tap', function(event) {
- getRtt();
- RCiPic2.show(function(items) {
- RCResultss33.value =items[0].text
- RCResultss33.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);
- //乡
- RCimm = new $.PopPicker({
- F_Layer: 1,
- });
- var RCs44= doc.getElementById('toutowns');
- var RCResults44 = doc.getElementById('touorder_xiang');
- RCs44.addEventListener('tap', function(event) {
- villagoo();
- RCimm.show(function(items) {
- RCResults44.value =items[0].text
- RCResults44.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 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 RCiPickers = new $.PopPicker({
- F_Layer: 1,
- });
- RCiPickers.setData(recive);
- var RCs = doc.getElementById('showZhuTi');
- var RCResults = doc.getElementById('order_rengin');
- RCs.addEventListener('tap', function(event) {
- RCiPickers.show(function(items) {
- console.log(items[0].text)
- RCResults.value =items[0].text
- RCResults.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);
- //市
- RCiPicke = new $.PopPicker({
- F_Layer: 1,
- });
-
- var RCs1 = doc.getElementById('showZhuTiPicker');
- var RCResults1 = doc.getElementById('order_shi');
- RCs1.addEventListener('tap', function(event) {
- getReceiveUser();
- RCiPicke.show(function(items) {
- RCResults1.value =items[0].text
- RCResults1.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);
-
- //区/县
- RCiPi = new $.PopPicker({
- F_Layer: 1,
- });
- var RCs2 = doc.getElementById('county');
- var RCResults2 = doc.getElementById('order_xian');
- RCs2.addEventListener('tap', function(event) {
- getRe();
- RCiPi.show(function(items) {
- RCResults2.value =items[0].text
- RCResults2.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);
- //乡
- RCi = new $.PopPicker({
- F_Layer: 1,
- });
- var RCs3= doc.getElementById('towns');
- var RCResults3 = doc.getElementById('order_xiang');
- RCs3.addEventListener('tap', function(event) {
- village();
- RCi.show(function(items) {
- RCResults3.value =items[0].text
- RCResults3.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 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 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 tou = new $.PopPicker();
- // tou.setData(tousu);
- // var showCityPickerButton = doc.getElementById('quest');
- // var cityResult = doc.getElementById('order_cat');
- // showCityPickerButton.addEventListener('tap', function(event) {
- // tou.show(function(items) {
- // cityResult.value = items[0].text;
- // cityResult.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].text);
- //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].text);
- //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].text);
- //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;
-
- $('#yewu').text(result.F_Salesman);
- $('#dianhua').text(result.F_SalesPhone);
- $('#daqu').text(result.F_AreaName);
- $('#fengsi').text(result.F_BranchName);
- $('#jyppai').text(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', //HTTP请求类型
- success: function(data) {
- if(data.state.toLowerCase() == "success") {
- var result = data.data;
- $("#wname").text(data.model.F_MaterialName);//物料名称
- $("#xhao").text(data.model.F_Model),//型号
- $("#gge").text(data.model.F_Specs);//规格
- $("#yijif").text(data.model.F_Level1);//一级分类
- $("#erjif").text(data.model.F_Level2);//二级分类
- $("#sanjif").text(data.model.F_Level3);//三级分类
- $('#pinp').text(data.model.F_Brand);//品牌
- $('#fhffx').text(data.model.F_MaterialEffect); //复合肥肥效
- $('#cpxx').text(data.model.F_Pipeline); //产品线tensions
- $("#gyii").text(data.model.F_Craft);//工艺
- }
- },
- error: function(xhr, type, errorThrown) {
- //异常处理;
- }
- })
-
- });
|