暫無描述

AddWorkolder.js 45KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627
  1. mui.init({
  2. swipeBack: false,
  3. })
  4. var UserCode = helper.cookies.get("usercode");
  5. var openid = helper.cookies.get("openid");
  6. var areaID = helper.request.queryString("areaID");
  7. var UserType = helper.cookies.get("usertype");
  8. var year=new Date().getFullYear();
  9. var month=new Date().getMonth();
  10. var day=new Date().getDate();
  11. mui('#order_time').each(function(i, btn) {  
  12. btn.addEventListener('tap', function() {   
  13. var dtPicker = new mui.DtPicker({    
  14. type: "date", //设置日历初始视图模式
  15. //beginDate: new Date(year, month, day),//设置开始日期
  16.   
  17. });  
  18. dtPicker.show(function(e) {
  19. $("#order_time").val(e)
  20. }); 
  21. }, false);
  22. })
  23. $(function() {
  24. //解决input点击跳转顶部问题
  25. $("input").on("blur", function () {
  26. $("body").removeClass("mui-focusin")
  27. })
  28. $("textarea").on("blur", function () {
  29. $("body").removeClass("mui-focusin")
  30. })
  31. if(UserType&&UserType==4){
  32. $('.suggest').css('display','inline-block')
  33. $(".order_type input[type=radio][value='2']").prop("checked", true);
  34. $('#complaint').show();
  35. $('#consult').hide();
  36. $('#spot').hide();
  37. $('#kehmm').show();
  38. $('#qtton').hide();
  39. $('.noSamplTime').show();
  40. $('.SamplTime').hide();
  41. $(".overtime input[type=radio][value='168']").prop("checked", true);
  42. }else{
  43. $('.order_type').css('display','inline-block')
  44. $('#consult').show()
  45. }
  46. // 投诉咨询切换
  47. $('.order_type').find('input[type="radio"]').on('change', function() {
  48. if($(this).val() === "1") {
  49. Complaint_clear();//投诉部分
  50. spotCheck_clear();//抽检部分
  51. suggest_clear();//建议部分
  52. common_clear();//公共部分
  53. $('#consult').show(); //kehmm qtton
  54. $('#complaint').hide();
  55. $('#spot').hide();
  56. $('#kehmm').hide();
  57. $('#qtton').hide();
  58. $('.noSamplTime').show();
  59. $('.SamplTime').hide();
  60. $(".overtime input[type=radio][value='12']").prop("checked", true);
  61. } else if($(this).val() === "2"){
  62. Consultation_clear();//咨询部分
  63. spotCheck_clear();//抽检部分
  64. suggest_clear();//建议部分
  65. common_clear();//公共部分
  66. $('#complaint').show();
  67. $('#consult').hide();
  68. $('#spot').hide();
  69. $('#kehmm').show();
  70. $('#qtton').hide();
  71. $('.noSamplTime').show();
  72. $('.SamplTime').hide();
  73. $(".overtime input[type=radio][value='168']").prop("checked", true);
  74. }else if($(this).val() === "3"){
  75. Consultation_clear();//咨询部分
  76. Complaint_clear();//投诉部分
  77. suggest_clear();//建议部分
  78. common_clear();//公共部分
  79. $('#spot').show();
  80. $('#consult').hide();
  81. $('#complaint').hide();
  82. $('#kehmm').show();
  83. $('#qtton').hide();
  84. $('.noSamplTime').hide();
  85. $('.SamplTime').show();
  86. $(".overtime input[type=radio][value='2160']").prop("checked", true);
  87. }else if($(this).val() === "4"){
  88. Consultation_clear();//咨询部分
  89. Complaint_clear();//投诉部分
  90. spotCheck_clear();//抽检部分
  91. common_clear();//公共部分
  92. $('#spot').hide();
  93. $('#consult').hide();
  94. $('#complaint').hide();
  95. $('#kehmm').hide();
  96. $('#qtton').show();
  97. $('.noSamplTime').show();
  98. $('.SamplTime').hide();
  99. $(".overtime input[type=radio][value='12']").prop("checked", true);
  100. }
  101. });
  102. // 完结不完结切换
  103. $('.wjbwj').find('input[type="radio"]').on('change', function() {
  104. if($(this).val() === "1") { //投诉
  105. //receive
  106. $('#zhipaiyin').hide();
  107. $('#wanji').show();
  108. $('#zhipaaa').hide();
  109. $('#submit').hide();
  110. } else if($(this).val() === "2"){
  111. $('#zhipaiyin').show();
  112. $('#wanji').hide();
  113. $('#zhipaaa').hide();
  114. $('#submit').hide();
  115. }
  116. });
  117. // 指派切换
  118. $('.zhipp').find('input[type="radio"]').on('change', function() {
  119. if($(this).val() === "3") { //投诉
  120. //receive
  121. $('#zhipaaa').show();
  122. $('#buzp').show();
  123. $('#submit').hide();
  124. $('#wanji').hide();
  125. } else if($(this).val() === "4"){
  126. $('#zhipaaa').hide();
  127. $('#buzp').hide();
  128. $('#submit').show();
  129. $('#wanji').hide();
  130. }
  131. });
  132. //工单有效性
  133. $('#order_valid').find('input[type="radio"]').on('change', function() {
  134. //是否有效工单项(0有效,1无效)
  135. if($(this).val() === "1") { //无效
  136. $('.order_note').show();
  137. } else {
  138. $('.order_note').hide();
  139. }
  140. });
  141. //咨询清空
  142. function Consultation_clear(){
  143. $('#order_category').val('');
  144. $('#order_productname').val('');//产品名称
  145. $('#order_Claimnumber').val('');//问题数量
  146. $('#ower_relationship').val('');//销售基地
  147. }
  148. //投诉清空
  149. function Complaint_clear(){
  150. $('#order_product').val('');//产品名称
  151. $('#ower_Sales_base').val('');//销售基地
  152. $('#order_cat').val('');//问题类别1
  153. $('#order_question').val('');//问题类别2
  154. $('#order_prer').val('');//问题类别3
  155. $('#order_batch').val('');//生产批次号
  156. $('#order_Claimnu').val('');//问题数量
  157. }
  158. //抽检清空
  159. function spotCheck_clear(){
  160. $('#order_wentlb').val('');//问题类别
  161. $('#batch_num').val('');//生产批次号
  162. $('#order_time').val('');//抽检时间
  163. $('#order_samplingle').val('');//抽检级别
  164. $('#order_lingunit').val('');//抽检单位
  165. $('#order_assay').val('');//化验单位
  166. $('#order_tunnage').val('');//抽检吨数
  167. $('#order_algebra').val('');//抽检袋数
  168. $('#order_money').val('');//费用金额
  169. }
  170. //建议清空
  171. function suggest_clear(){
  172. $('#order_texta').val('');//问题类别
  173. $('#order_chpi').val('');//产品名称
  174. $('#order_wensu').val('');//问题数量
  175. $('#ower_showCpke').val('');//销售基地
  176. }
  177. //公共部分清空
  178. function common_clear(){
  179. $('#order_coding').val('');//客户编号
  180. $('#order_yewu').val('');//业务员
  181. $('#order_yewuphone').val('');//业务员电话
  182. $('#order_macrocell').val('');//大区
  183. $('#order_branch').val('');//分公司
  184. $('#order_pinpai').val('');//经营品牌
  185. $('#order_material').val('');//物料编码
  186. $('#order_name').val('');//客户姓名
  187. $('#order_phone').val('');//客户电话
  188. $('#choworder_rengin').val('');
  189. $('#shouorder_shi').val('');
  190. $('#chouorder_xian').val('');
  191. $('#chouorder_xiang').val('');
  192. $('#choworder_tower').val('');
  193. $('#order_reception').val('');
  194. }
  195. var catt;//问题类别
  196. var cttt;//投诉问题类别
  197. var comdi;//产品名称
  198. var coint; //销售基地
  199. var stion; //问题数量
  200. var shengch; //生产批次号
  201. var jyppai;
  202. var daqu;
  203. var fengo;
  204. var channel_type;
  205. var orderIsover;
  206. function typePro(){
  207. orderIsover=$('input:radio[name="form"]:checked').val();
  208. if(orderIsover === '1'){
  209. // debugger
  210. catt = $('#order_category').attr('data-index');//问题类别
  211. comdi = $('#order_productname').val();//产品名称
  212. stion = $('#order_Claimnumber').val();//问题数量
  213. coint=$('#ower_relationship').val();//销售基地
  214. daqu='';
  215. fengo='';
  216. channel_type='';
  217. jyppai='';
  218. cttt='';
  219. shengch='';
  220. $('#wlbm').hide();
  221. $('#wlmcc').hide();
  222. $('#clie').hide();
  223. $('#mate').hide();
  224. }else if(orderIsover=== '2'){
  225. daqu=$('#order_macrocell').val();
  226. fengo=$('#order_branch').val();
  227. channel_type=$('#channel_type').val();
  228. jyppai=$('#order_pinpai').val();
  229. comdi = $('#order_product').val();//产品名称
  230. // cttt = $('#order_matter').attr('data-index');//问题类别
  231. catt = $('#order_matter').attr('data-index');
  232. shengch=$('#order_batch').val();//生产批次号
  233. stion = $('#order_Claimnumber').val();//问题数量
  234. coint=$('#ower_Sales_base').val();//销售基地
  235. }else if(orderIsover === '3'){
  236. daqu=$('#order_macrocell').val();
  237. fengo=$('#order_branch').val();
  238. channel_type=$('#channel_type').val();
  239. jyppai=$('#order_pinpai').val();
  240. shengch=$('#batch_num').val();//生产批次号
  241. catt = $('#order_wentlb').attr('data-index');
  242. cttt='';
  243. comdi ='';
  244. coint='';
  245. stion='';
  246. }else if(orderIsover === '4'){
  247. catt = $('#order_texta').attr('data-index');//问题类别
  248. comdi = $('#order_chpi').val();//产品名称
  249. stion = $('#order_wensu').val();//问题数量
  250. coint=$('#ower_showCpke').val();//销售基地
  251. daqu='';
  252. fengo='';
  253. channel_type='';
  254. jyppai='';
  255. cttt='';
  256. shengch='';
  257. $('#wlbm').hide();
  258. $('#wlmcc').hide();
  259. $('#clie').hide();
  260. $('#mate').hide();
  261. }
  262. }
  263. //提交按钮
  264. $('#submit').on('tap', function() {
  265. // $(this).attr("disabled","disabled");
  266. typePro();
  267. var str_ary = '';
  268. $(".image-box").each(function (i, n) {
  269. var a = $(n).attr("indexs");
  270. if (a) {
  271. if (str_ary) {
  272. str_ary = str_ary + ',' + a;
  273. }
  274. else {
  275. str_ary = a;
  276. }
  277. }
  278. })
  279. // var myreg = /^[1][3,4,5,7,8][0-9]{9}$/;
  280. var myreg11 = /^(([0\+]\d{2,3}-)?((0\d{2,3}))?(-)?)?(\d{7,8})(-(\d{3,}))?$/;
  281. var str = $("#order_tel").val();
  282. if($('#order_name').val() == '') {
  283. mui.alert('请输入客户姓名!') //请输入工单类型
  284. } else if($('#order_phone').val() == '') {
  285. mui.alert('请输入客户电话!') //请输入客户姓名
  286. }else {
  287. var btnArray = ['否', '是'];
  288. mui.confirm('确定提交吗?', '提示', btnArray, function(f) {
  289. if(f.index == 1) {
  290. $.ajax({
  291. type: "post",
  292. dataType: 'json',
  293. url: huayi.config.callcenter_url + 'WxLogin/Add',
  294. beforeSend: function () {
  295. // 禁用按钮防止重复提交
  296. $("#submit").attr({ disabled: "disabled" });
  297. },
  298. async: true,
  299. data: {
  300. // F_State:0,
  301. F_WxOpenId: openid, //微信openid,
  302. F_Source: $('#order_source').attr('data-index'), //工单来源
  303. F_Type: $('.order_type').find('input[type="radio"]:checked').val(), //工单类型
  304. //公共字段
  305. F_CusName: $('#order_name').val(),//客户姓名
  306. F_CusPhone: $('#order_phone').val(),//客户电话
  307. F_CompanyName: $('#order_tel').val(),//公司名称
  308. F_IncidentProvince:$("#choworder_rengin").attr('data-index'), //省
  309. F_IncidentCity: $("#shouorder_shi").attr('data-index'), //市
  310. F_IncidentCountry:$("#chouorder_xian").attr('data-index'), //县
  311. F_IncidentTownship: $("#chouorder_xiang").attr('data-index'), //乡
  312. F_IncidentDetailed: $("#choworder_tower").val(), //详细地址
  313. F_Description:$("#order_reception").val(), //问题描述
  314. overtime:$('.overtime').find('input[type="radio"]:checked').val(),//超期时间
  315. sms:$('.sms').find('input[type="radio"]:checked').val(),//是否发送短信
  316. //咨询模块
  317. F_AddressFull:catt,//问题类别
  318. F_TS_Category: comdi,//产品名称
  319. F_ZX_Quantity:stion,//问题数量
  320. F_SalesBase:coint,//销售基地
  321. //投诉模块
  322. F_BatchNumber:shengch,//生产批号
  323. // F_TS_Formula: $('#formula').val(),//配方
  324. F_TS_Quantity:$("#order_Claimnu").val(), //问题数量 order_Claimnumber
  325. // F_TS_Level: $('#order_rank').val(),//重要界别
  326. F_SalesPhone: $('#order_yewuphone').val(),//电话
  327. F_QuestionType:catt,
  328. F_AreaName: daqu,//大区
  329. F_BranchName:fengo,//分公司
  330. F_Channel:channel_type,//渠道类型
  331. F_Brands: jyppai,//经营品牌
  332. F_Salesman: $('#order_yewu').val(),//业务员
  333. F_MaterialID: $('#order_material').val(),//物料编码
  334. F_CustomerID: $('#order_coding').val(),//客户编号
  335. F_Model: $('#order_xinghao').val(),//型号
  336. F_Specs: $('#order_guige').val(),//规格
  337. F_Level1: $('#order_yiji').val(),//一级分类
  338. F_Level2: $('#order_erji').val(),//二级分类
  339. F_Level3: $('#order_sanji').val(),//三级分类
  340. F_MaterialEffect: $('#order_fuhefei').val(),//复合肥肥效
  341. F_Pipeline: $('#order_chanpinxian').val(),//产品线
  342. F_Craft: $('#order_gongyi').val(),//工艺
  343. //抽检模块
  344. F_CJ_Time: $('#order_time').val(),//抽检时间
  345. F_CJ_Level: $('#order_samplingle').val(), //抽检级别
  346. F_CJ_Unit: $('#order_lingunit').val(), //抽检单位
  347. F_CJ_TestUnit: $('#order_assay').val(),//化验单位
  348. F_CJ_Tonnage: $('#order_tunnage').val(),//抽检吨数
  349. F_CJ_BagNo: $('#order_algebra').val(),//抽检袋数
  350. F_CJ_Outlay: $('#order_money').val(),//公关费用金额
  351. // F_Source: $('#order_source').attr('data-index'), //工单来源
  352. // F_Type: $('.order_type').find('input[type="radio"]:checked').val(), //工单类型
  353. F_Files:str_ary
  354. },
  355. success: function(data) {
  356. if(data.state == "success") {
  357. debugger
  358. //alert($('#order_reception').val()), //描述详情
  359. mui.toast('创建成功');
  360. window.location.href = "Have_list.html";
  361. } else {
  362. mui.toast(data.message);
  363. $("#submit").removeAttr("disabled")
  364. }
  365. }
  366. });
  367. } else {
  368. mui.toast("取消");
  369. }
  370. })
  371. }
  372. })
  373. function getDepts() {}
  374. // 投诉省市县乡
  375. var recivesww = [];
  376. $.ajax({
  377. type: "get",
  378. url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
  379. async: false,
  380. data: {
  381. F_Layer: 1,
  382. F_RegionName: $('#touorder_rengin').attr('data-index'),
  383. },
  384. dataType: 'json',
  385. success: function(res) {
  386. if(res.state.toLowerCase() === "success") {
  387. res = res.data;
  388. if(res && res.length > 0) {
  389. res.forEach(function(v, i) {
  390. var obj = {};
  391. obj.value = v.F_RegionId;
  392. obj.text = v.F_RegionName;
  393. recivesww.push(obj);
  394. });
  395. console.log(recivesww)
  396. // cityPicker5.setData(recive);
  397. }
  398. }
  399. //recive = res.data;
  400. //console.log(recive)
  401. //alert(JSON.stringify(data));
  402. }
  403. });
  404. function getRecect(){
  405. var renyuaee = []
  406. $.ajax({
  407. url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
  408. type: 'get',
  409. data: {
  410. F_Layer: 2,
  411. F_RegionName: $('#touorder_rengin').attr('data-index'),
  412. },
  413. dataType: "json",
  414. async: true,
  415. success: function(res) {
  416. if(res.state.toLowerCase() === "success") {
  417. res = res.data;
  418. if(res && res.length >0) {
  419. res.forEach(function(v, i) {
  420. var obj = {};
  421. obj.value = v.F_RegionId;
  422. obj.text = v.F_RegionName;
  423. renyuaee.push(obj);
  424. //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
  425. });
  426. RCiPickee2.setData(renyuaee);
  427. }
  428. }
  429. },
  430. });
  431. }
  432. //区县
  433. function getRtt(){
  434. var rener = []
  435. $.ajax({
  436. url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
  437. type: 'get',
  438. data: {
  439. F_Layer:3,
  440. F_RegionName: $('#touorder_shi').attr('data-index'),
  441. },
  442. dataType: "json",
  443. async: true,
  444. success: function(res) {
  445. if(res.state.toLowerCase() === "success") {
  446. res = res.data;
  447. if(res && res.length >0) {
  448. res.forEach(function(v, i) {
  449. var obj = {};
  450. obj.value = v.F_RegionId;
  451. obj.text = v.F_RegionName;
  452. rener.push(obj);
  453. //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
  454. });
  455. RCiPic2.setData(rener);
  456. }
  457. }
  458. },
  459. });
  460. }
  461. //乡
  462. function villagoo(){
  463. var viyy = []
  464. $.ajax({
  465. url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
  466. type: 'get',
  467. data: {
  468. F_Layer:4,
  469. F_RegionName: $('#touorder_xian').attr('data-index'),
  470. },
  471. dataType: "json",
  472. async: true,
  473. success: function(res) {
  474. if(res.state.toLowerCase() === "success") {
  475. res = res.data;
  476. if(res && res.length >0) {
  477. res.forEach(function(v, i) {
  478. var obj = {};
  479. obj.value = v.F_RegionId;
  480. obj.text = v.F_RegionName;
  481. viyy.push(obj);
  482. //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
  483. });
  484. RCimm.setData(viyy);
  485. }
  486. }
  487. },
  488. });
  489. }
  490. // 咨询省市县乡
  491. var recives = [];
  492. $.ajax({
  493. type: "get",
  494. url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
  495. async: false,
  496. data: {
  497. F_Layer: 1,
  498. F_RegionName: $('#choworder_rengin').attr('data-index'),
  499. },
  500. dataType: 'json',
  501. success: function(res) {
  502. if(res.state.toLowerCase() === "success") {
  503. res = res.data;
  504. if(res && res.length > 0) {
  505. res.forEach(function(v, i) {
  506. var obj = {};
  507. obj.value = v.F_RegionId;
  508. obj.text = v.F_RegionName;
  509. recives.push(obj);
  510. });
  511. // cityPicker5.setData(recive);
  512. }
  513. }
  514. //recive = res.data;
  515. //console.log(recive)
  516. //alert(JSON.stringify(data));
  517. }
  518. });
  519. //市
  520. function getRece(){
  521. var renyuann = []
  522. $.ajax({
  523. url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
  524. type: 'get',
  525. data: {
  526. F_Layer: 2,
  527. F_RegionName: $('#choworder_rengin').attr('data-index'),
  528. },
  529. dataType: "json",
  530. async: true,
  531. success: function(res) {
  532. if(res.state.toLowerCase() === "success") {
  533. res = res.data;
  534. if(res && res.length >0) {
  535. res.forEach(function(v, i) {
  536. var obj = {};
  537. obj.value = v.F_RegionId;
  538. obj.text = v.F_RegionName;
  539. renyuann.push(obj);
  540. //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
  541. });
  542. RCiPickee1.setData(renyuann);
  543. }
  544. }
  545. },
  546. });
  547. }
  548. //区/县
  549. function getReee(){
  550. var rennn = []
  551. $.ajax({
  552. url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
  553. type: 'get',
  554. data: {
  555. F_Layer:3,
  556. F_RegionName: $('#shouorder_shi').attr('data-index'),
  557. },
  558. dataType: "json",
  559. async: true,
  560. success: function(res) {
  561. if(res.state.toLowerCase() === "success") {
  562. res = res.data;
  563. if(res && res.length >0) {
  564. res.forEach(function(v, i) {
  565. var obj = {};
  566. obj.value = v.F_RegionId;
  567. obj.text = v.F_RegionName;
  568. rennn.push(obj);
  569. //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
  570. });
  571. RCiPi1.setData(rennn);
  572. }
  573. }
  574. },
  575. });
  576. }
  577. //乡
  578. function villagee(){
  579. var villl = []
  580. $.ajax({
  581. url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
  582. type: 'get',
  583. data: {
  584. F_Layer:4,
  585. F_RegionName: $('#chouorder_xian').attr('data-index'),
  586. },
  587. dataType: "json",
  588. async: true,
  589. success: function(res) {
  590. if(res.state.toLowerCase() === "success") {
  591. res = res.data;
  592. if(res && res.length >0) {
  593. res.forEach(function(v, i) {
  594. var obj = {};
  595. obj.value = v.F_RegionId;
  596. obj.text = v.F_RegionName;
  597. villl.push(obj);
  598. //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
  599. });
  600. RCi12.setData(villl);
  601. }
  602. }
  603. },
  604. });
  605. }
  606. //投诉省市县乡
  607. // 省
  608. var recive = [];
  609. $.ajax({
  610. type: "get",
  611. url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
  612. async: false,
  613. data: {
  614. F_Layer: 1,
  615. F_RegionName: $('#order_rengin').attr('data-index'),
  616. },
  617. dataType: 'json',
  618. success: function(res) {
  619. if(res.state.toLowerCase() === "success") {
  620. res = res.data;
  621. if(res && res.length > 0) {
  622. res.forEach(function(v, i) {
  623. var obj = {};
  624. obj.value = v.F_RegionId;
  625. obj.text = v.F_RegionName;
  626. recive.push(obj);
  627. });
  628. // cityPicker5.setData(recive);
  629. }
  630. }
  631. //recive = res.data;
  632. //console.log(recive)
  633. //alert(JSON.stringify(data));
  634. }
  635. });
  636. //市
  637. function getReceiveUser(){
  638. var renyuan = []
  639. $.ajax({
  640. url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
  641. type: 'get',
  642. data: {
  643. F_Layer: 2,
  644. F_RegionName: $('#order_rengin').attr('data-index'),
  645. },
  646. dataType: "json",
  647. async: true,
  648. success: function(res) {
  649. if(res.state.toLowerCase() === "success") {
  650. res = res.data;
  651. if(res && res.length >0) {
  652. res.forEach(function(v, i) {
  653. var obj = {};
  654. obj.value = v.F_RegionId;
  655. obj.text = v.F_RegionName;
  656. renyuan.push(obj);
  657. //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
  658. });
  659. RCiPicke.setData(renyuan);
  660. }
  661. }
  662. },
  663. });
  664. }
  665. //区/县
  666. function getRe(){
  667. var ren = []
  668. $.ajax({
  669. url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
  670. type: 'get',
  671. data: {
  672. F_Layer:3,
  673. F_RegionName: $('#order_shi').attr('data-index'),
  674. },
  675. dataType: "json",
  676. async: true,
  677. success: function(res) {
  678. if(res.state.toLowerCase() === "success") {
  679. res = res.data;
  680. if(res && res.length >0) {
  681. res.forEach(function(v, i) {
  682. var obj = {};
  683. obj.value = v.F_RegionId;
  684. obj.text = v.F_RegionName;
  685. ren.push(obj);
  686. //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
  687. });
  688. RCiPi.setData(ren);
  689. }
  690. }
  691. },
  692. });
  693. }
  694. //乡
  695. function village(){
  696. var vil = []
  697. $.ajax({
  698. url: huayi.config.callcenter_url + 'RegionCategory/GetAllList',
  699. type: 'get',
  700. data: {
  701. F_Layer:4,
  702. F_RegionName: $('#order_xian').attr('data-index'),
  703. },
  704. dataType: "json",
  705. async: true,
  706. success: function(res) {
  707. if(res.state.toLowerCase() === "success") {
  708. res = res.data;
  709. if(res && res.length >0) {
  710. res.forEach(function(v, i) {
  711. var obj = {};
  712. obj.value = v.F_RegionId;
  713. obj.text = v.F_RegionName;
  714. vil.push(obj);
  715. //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
  716. });
  717. RCi.setData(vil);
  718. }
  719. }
  720. },
  721. });
  722. }
  723. //获取上一级
  724. Ajax();
  725. function Ajax() {
  726. $.ajax({
  727. url: huayi.config.callcenter_url + 'WxLogin/GetDpment',
  728. data: {
  729. OpenId: openid, //微信openid,
  730. },
  731. async: true,
  732. dataType: 'json',
  733. type: 'get', //HTTP请求类型
  734. success: function(data) {
  735. if(data.state.toLowerCase() == "success") {
  736. var result = data.data;
  737. $("#custo").text(result.F_UserName);
  738. $("#cus").text(result.F_UserCode);
  739. }
  740. },
  741. error: function(xhr, type, errorThrown) {
  742. //异常处理;
  743. }
  744. })
  745. }
  746. //销售基地
  747. var keyList = [];
  748. // console.log(keyList);
  749. $.ajax({
  750. type: "get",
  751. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  752. async: false,
  753. data: {
  754. flag: 'XSJD'
  755. },
  756. dataType: 'json',
  757. success: function(data) {
  758. var key_data = data.data;
  759. // console.log(data.data);
  760. $(key_data).each(function(i, n) {
  761. var obj = {};
  762. obj.value = n.F_DictionaryValueId;
  763. obj.text = n.F_Name;
  764. keyList.push(obj)
  765. })
  766. }
  767. });
  768. //问题类别
  769. var ke = [];
  770. $.ajax({
  771. type: "get",
  772. url: huayi.config.callcenter_url + 'WorkOrder/GetQuestionNameType',
  773. async: false,
  774. data: {
  775. type:3,
  776. },
  777. dataType: 'json',
  778. success: function(res) {
  779. if(res.state.toLowerCase() === "success") {
  780. res = res.data;
  781. if(res && res.length > 0) {
  782. res.forEach(function(v, i) {
  783. var obj = {};
  784. obj.value = v.id;
  785. obj.text = v.text;
  786. ke.push(obj);
  787. });
  788. // cityPicker5.setData(recive);
  789. }
  790. }
  791. }
  792. });
  793. //抽检问题类别
  794. var kees = [];
  795. $.ajax({
  796. type: "get",
  797. url: huayi.config.callcenter_url + 'WorkOrder/GetQuestionNameType',
  798. async: false,
  799. data: {
  800. type:2,
  801. },
  802. dataType: 'json',
  803. success: function(res) {
  804. if(res.state.toLowerCase() === "success") {
  805. res = res.data;
  806. if(res && res.length > 0) {
  807. res.forEach(function(v, i) {
  808. var obj = {};
  809. obj.value = v.id;
  810. obj.text = v.text;
  811. kees.push(obj);
  812. });
  813. // cityPicker5.setData(recive);
  814. }
  815. }
  816. }
  817. });
  818. //产品名称
  819. var keee = [];
  820. $.ajax({
  821. type: "get",
  822. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  823. async: false,
  824. data: {
  825. flag: 'CPZL'
  826. },
  827. dataType: 'json',
  828. success: function(data) {
  829. var key_data = data.data;
  830. // console.log(key_data);
  831. $(key_data).each(function(i, n) {
  832. var obj = {};
  833. obj.value = n.F_DictionaryValueId;
  834. obj.text = n.F_Name;
  835. keee.push(obj)
  836. // console.log(ke);
  837. })
  838. }
  839. });
  840. //投诉产品名称
  841. var letter = [];
  842. $.ajax({
  843. type: "get",
  844. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  845. async: false,
  846. data: {
  847. flag: 'CPZL'
  848. },
  849. dataType: 'json',
  850. success: function(data) {
  851. var key_data = data.data;
  852. $(key_data).each(function(i, n) {
  853. var obj = {};
  854. obj.value = n.F_DictionaryValueId;
  855. obj.text = n.F_Name;
  856. letter.push(obj)
  857. })
  858. }
  859. });
  860. //投诉重要级别
  861. var rank = [];
  862. $.ajax({
  863. type: "get",
  864. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  865. async: false,
  866. data: {
  867. flag: 'ZYJB'
  868. },
  869. dataType: 'json',
  870. success: function(data) {
  871. var key_data = data.data;
  872. // console.log(key_data);
  873. $(key_data).each(function(i, n) {
  874. var obj = {};
  875. obj.value = n.F_DictionaryValueId;
  876. obj.text = n.F_Name;
  877. rank.push(obj)
  878. // console.log(ke);
  879. })
  880. }
  881. });
  882. //抽检抽检级别
  883. var check = [];
  884. $.ajax({
  885. type: "get",
  886. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  887. async: false,
  888. data: {
  889. flag: 'CJJP'
  890. },
  891. dataType: 'json',
  892. success: function(data) {
  893. var key_data = data.data;
  894. // console.log(key_data);
  895. $(key_data).each(function(i, n) {
  896. var obj = {};
  897. obj.value = n.F_DictionaryValueId;
  898. obj.text = n.F_Name;
  899. check.push(obj)
  900. })
  901. }
  902. });
  903. //抽检抽检单位
  904. var monad = [];
  905. $.ajax({
  906. type: "get",
  907. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  908. async: false,
  909. data: {
  910. flag: 'CJDW'
  911. },
  912. dataType: 'json',
  913. success: function(data) {
  914. var key_data = data.data;
  915. // console.log(key_data);
  916. $(key_data).each(function(i, n) {
  917. var obj = {};
  918. obj.value = n.F_DictionaryValueId;
  919. obj.text = n.F_Name;
  920. monad.push(obj)
  921. })
  922. }
  923. });
  924. //渠道类型
  925. var channelType = [];
  926. $.ajax({
  927. type: "get",
  928. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  929. async: false,
  930. data: {
  931. flag: 'QDLX'
  932. },
  933. dataType: 'json',
  934. success: function(data) {
  935. var key_data = data.data;
  936. $(key_data).each(function(i, n) {
  937. var obj = {};
  938. obj.value = n.F_DictionaryValueId;
  939. obj.text = n.F_Name;
  940. channelType.push(obj)
  941. })
  942. }
  943. });
  944. //大区
  945. var lisboa = [];
  946. $.ajax({
  947. type: "get",
  948. url: huayi.config.callcenter_url + 'Department/GetList',
  949. async: false,
  950. data: {
  951. F_Layer: 1,
  952. F_DeptName: $('#order_macrocell').attr('data-index'),
  953. },
  954. dataType: 'json',
  955. success: function(res) {
  956. if(res.state.toLowerCase() === "success") {
  957. res = res.data;
  958. if(res && res.length > 0) {
  959. res.forEach(function(v, i) {
  960. var obj = {};
  961. obj.value = v.F_DeptId;
  962. obj.text = v.F_DeptName;
  963. lisboa.push(obj);
  964. });
  965. // cityPicker5.setData(recive);
  966. }
  967. }
  968. //recive = res.data;
  969. //console.log(recive)
  970. //alert(JSON.stringify(data));
  971. }
  972. });
  973. //分公司
  974. function fengong(){
  975. var filiale = []
  976. $.ajax({
  977. url: huayi.config.callcenter_url + 'Department/GetList',
  978. type: 'get',
  979. data: {
  980. F_Layer:2,
  981. F_DeptName: $('#order_macrocell').attr('data-index'),
  982. },
  983. dataType: "json",
  984. async: true,
  985. success: function(res) {
  986. if(res.state.toLowerCase() === "success") {
  987. res = res.data;
  988. if(res && res.length >0) {
  989. res.forEach(function(v, i) {
  990. var obj = {};
  991. obj.value = v.F_DeptId;
  992. obj.text = v.F_DeptName;
  993. filiale.push(obj);
  994. //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
  995. });
  996. // console.log(vil)
  997. company.setData(filiale);
  998. }
  999. }
  1000. },
  1001. });
  1002. }
  1003. //投诉问题类别1
  1004. var complaints = [];
  1005. $.ajax({
  1006. type: "get",
  1007. url: huayi.config.callcenter_url + 'WorkOrder/GetQuestionNameType',
  1008. async: false,
  1009. data: {
  1010. type:1,
  1011. },
  1012. dataType: 'json',
  1013. success: function(res) {
  1014. if(res.state.toLowerCase() === "success") {
  1015. res = res.data;
  1016. if(res && res.length > 0) {
  1017. res.forEach(function(v, i) {
  1018. var obj = {};
  1019. obj.value = v.id;
  1020. obj.text = v.text;
  1021. complaints.push(obj);
  1022. });
  1023. // cityPicker5.setData(recive);
  1024. }
  1025. }
  1026. //recive = res.data;
  1027. //console.log(recive)
  1028. //alert(JSON.stringify(data));
  1029. }
  1030. });
  1031. //投诉问题类别2
  1032. function range(){
  1033. if(!$('#order_cat').val()){
  1034. mui.alert('请选择问题类别1');
  1035. return
  1036. }
  1037. var more = []
  1038. $.ajax({
  1039. url: huayi.config.callcenter_url + 'WorkOrder/GetQuestionNameType',
  1040. type: 'get',
  1041. data: {
  1042. QuestionName:$('#order_cat').val(),
  1043. type:1,
  1044. },
  1045. dataType: "json",
  1046. async: true,
  1047. success: function(res) {
  1048. if(res.state.toLowerCase() === "success") {
  1049. res = res.data;
  1050. if(res && res.length >0) {
  1051. res.forEach(function(v, i) {
  1052. var obj = {};
  1053. obj.value = v.id;
  1054. obj.text = v.text;
  1055. more .push(obj);
  1056. // $('<option value="' + v.id + '">' + v.text + '</option>').appendTo('#order_recive');
  1057. });
  1058. com.setData(more);
  1059. }
  1060. }
  1061. },
  1062. });
  1063. }
  1064. //投诉问题类别3
  1065. function which(){
  1066. if(!$('#order_question').val()){
  1067. mui.alert('请选择问题类别2');
  1068. return
  1069. }
  1070. var vector = []
  1071. $.ajax({
  1072. url: huayi.config.callcenter_url + 'WorkOrder/GetQuestionNameType',
  1073. type: 'get',
  1074. data: {
  1075. QuestionName:$('#order_question').val(),
  1076. type:1,
  1077. },
  1078. dataType: "json",
  1079. async: true,
  1080. success: function(res) {
  1081. if(res.state.toLowerCase() === "success") {
  1082. res = res.data;
  1083. if(res && res.length >0) {
  1084. res.forEach(function(v, i) {
  1085. var obj = {};
  1086. obj.value = v.id;
  1087. obj.text = v.text;
  1088. vector .push(obj);
  1089. // $('<option value="' + v.id + '">' + v.text + '</option>').appendTo('#order_recive');
  1090. });
  1091. since.setData(vector);
  1092. }
  1093. }
  1094. },
  1095. });
  1096. }
  1097. (function($, doc) {
  1098. $.init();
  1099. $.ready(function() {
  1100. // 咨询 省
  1101. var RCiP = new $.PopPicker({
  1102. F_Layer: 1,
  1103. });
  1104. RCiP.setData(recives);
  1105. var RCss1 = doc.getElementById('chouhuTi');
  1106. var RCResultss = doc.getElementById('choworder_rengin');
  1107. RCss1.addEventListener('tap', function(event) {
  1108. doc.getElementById('shouorder_shi').value="";
  1109. doc.getElementById('chouorder_xian').value="";
  1110. doc.getElementById('chouorder_xiang').value="";
  1111. RCiP.show(function(items) {
  1112. console.log(items[0].text)
  1113. RCResultss.value =items[0].text
  1114. RCResultss.setAttribute("data-index", items[0].text);
  1115. });
  1116. }, false);
  1117. //市
  1118. RCiPickee1 = new $.PopPicker({
  1119. F_Layer: 1,
  1120. });
  1121. var RCss2 = doc.getElementById('chowZhuTiPicker');
  1122. var RCResultss2 = doc.getElementById('shouorder_shi');
  1123. RCss2.addEventListener('tap', function(event) {
  1124. getRece();
  1125. RCiPickee1.show(function(items) {
  1126. doc.getElementById('chouorder_xian').value="";
  1127. doc.getElementById('chouorder_xiang').value="";
  1128. if (items[0].text!=undefined) {
  1129. RCResultss2.value =items[0].text
  1130. RCResultss2.setAttribute("data-index", items[0].text);
  1131. }
  1132. });
  1133. }, false);
  1134. //区/县
  1135. RCiPi1 = new $.PopPicker({
  1136. F_Layer: 1,
  1137. });
  1138. var RCs22 = doc.getElementById('chowcounty');
  1139. var RCResults22 = doc.getElementById('chouorder_xian');
  1140. RCs22.addEventListener('tap', function(event) {
  1141. getReee();
  1142. RCiPi1.show(function(items) {
  1143. doc.getElementById('chouorder_xiang').value="";
  1144. if (items[0].text!=undefined) {
  1145. RCResults22.value =items[0].text
  1146. RCResults22.setAttribute("data-index", items[0].text);
  1147. }
  1148. });
  1149. }, false);
  1150. //乡
  1151. RCi12 = new $.PopPicker({
  1152. F_Layer: 1,
  1153. });
  1154. var RCs33= doc.getElementById('chowtowns');
  1155. var RCResults33 = doc.getElementById('chouorder_xiang');
  1156. RCs33.addEventListener('tap', function(event) {
  1157. villagee();
  1158. RCi12.show(function(items) {
  1159. if (items[0].text!=undefined) {
  1160. RCResults33.value =items[0].text
  1161. RCResults33.setAttribute("data-index", items[0].text);
  1162. }
  1163. });
  1164. }, false);
  1165. //销售基地
  1166. var cityPicker3 = new $.PopPicker();
  1167. cityPicker3.setData(keyList);
  1168. var showCityPickerButton = doc.getElementById('showCityPicker3');
  1169. var cityResult3 = doc.getElementById('ower_relationship');
  1170. showCityPickerButton.addEventListener('tap', function(event) {
  1171. cityPicker3.show(function(items) {
  1172. cityResult3.value = items[0].text;
  1173. cityResult3.setAttribute("data-index", items[0].value);
  1174. //返回 false 可以阻止选择框的关闭
  1175. //return false;
  1176. });
  1177. }, false);
  1178. //其他销售基地
  1179. var cityPicker9 = new $.PopPicker();
  1180. cityPicker9.setData(keyList);
  1181. var showCityPickerButton9 = doc.getElementById('showCpke');
  1182. var cityResult9 = doc.getElementById('ower_showCpke');
  1183. showCityPickerButton9.addEventListener('tap', function(event) {
  1184. cityPicker9.show(function(items) {
  1185. cityResult9.value = items[0].text;
  1186. cityResult9.setAttribute("data-index", items[0].value);
  1187. //返回 false 可以阻止选择框的关闭
  1188. //return false;
  1189. });
  1190. }, false);
  1191. //投诉销售基地
  1192. var cityPicker4 = new $.PopPicker();
  1193. cityPicker4.setData(keyList);
  1194. var showCityPickerButton4 = doc.getElementById('Sales_base');
  1195. var cityResult4 = doc.getElementById('ower_Sales_base');
  1196. showCityPickerButton4.addEventListener('tap', function(event) {
  1197. cityPicker3.show(function(items) {
  1198. cityResult4.value = items[0].text;
  1199. cityResult4.setAttribute("data-index", items[0].value);
  1200. //返回 false 可以阻止选择框的关闭
  1201. //return false;
  1202. });
  1203. }, false);
  1204. //问题类别
  1205. var city = new $.PopPicker();
  1206. city.setData(ke);
  1207. var showCityPickerButton = doc.getElementById('question');
  1208. var cityResult = doc.getElementById('order_category');
  1209. showCityPickerButton.addEventListener('tap', function(event) {
  1210. city.show(function(items) {
  1211. cityResult.value = items[0].text;
  1212. cityResult.setAttribute("data-index", items[0].value);
  1213. //返回 false 可以阻止选择框的关闭
  1214. //return false;
  1215. });
  1216. }, false);
  1217. //抽检问题类别
  1218. var cityes = new $.PopPicker();
  1219. cityes.setData(kees);
  1220. var showCityPickerButton6 = doc.getElementById('wentilb');
  1221. var cityResult6 = doc.getElementById('order_wentlb');
  1222. showCityPickerButton6.addEventListener('tap', function(event) {
  1223. cityes.show(function(items) {
  1224. cityResult6.value = items[0].text;
  1225. cityResult6.setAttribute("data-index", items[0].value);
  1226. //返回 false 可以阻止选择框的关闭
  1227. //return false;
  1228. });
  1229. }, false);
  1230. //其他问题类别
  1231. var citytt = new $.PopPicker();
  1232. citytt.setData(ke);
  1233. var showCityPickerButton7 = doc.getElementById('texta');
  1234. var cityResult7 = doc.getElementById('order_texta');
  1235. showCityPickerButton7.addEventListener('tap', function(event) {
  1236. citytt.show(function(items) {
  1237. cityResult7.value = items[0].text;
  1238. cityResult7.setAttribute("data-index", items[0].value);
  1239. //返回 false 可以阻止选择框的关闭
  1240. //return false;
  1241. });
  1242. }, false);
  1243. // //游客渠道类型
  1244. // var citye = new $.PopPicker();
  1245. // citye.setData(annel);
  1246. // var showCityPickerButt = doc.getElementById('trench');
  1247. // var cityResultion = doc.getElementById('manager');
  1248. // showCityPickerButt.addEventListener('tap', function(event) {
  1249. // citye.show(function(items) {
  1250. // cityResultion.value = items[0].text;
  1251. // cityResultion.setAttribute("data-index", items[0].value);
  1252. // //返回 false 可以阻止选择框的关闭
  1253. // //return false;
  1254. // });
  1255. // }, false);
  1256. //渠道类型
  1257. var citye = new $.PopPicker();
  1258. citye.setData(channelType);
  1259. var showCityPickerButt = doc.getElementById('order_channel');
  1260. var cityResultion = doc.getElementById('channel_type');
  1261. showCityPickerButt.addEventListener('tap', function(event) {
  1262. citye.show(function(items) {
  1263. cityResultion.value = items[0].text;
  1264. cityResultion.setAttribute("data-index", items[0].value);
  1265. //返回 false 可以阻止选择框的关闭
  1266. //return false;
  1267. });
  1268. }, false);
  1269. //产品名称
  1270. var cityc = new $.PopPicker();
  1271. cityc.setData(keee);
  1272. var showCityPickerButton1 = doc.getElementById('product');
  1273. var cityResultc1 = doc.getElementById('order_productname');
  1274. showCityPickerButton1.addEventListener('tap', function(event) {
  1275. cityc.show(function(items) {
  1276. cityResultc1.value = items[0].text;
  1277. cityResultc1.setAttribute("data-index", items[0].value);
  1278. //返回 false 可以阻止选择框的关闭
  1279. //return false;
  1280. });
  1281. }, false);
  1282. //其他产品名称
  1283. var citycea = new $.PopPicker();
  1284. citycea.setData(keee);
  1285. var showCityPickerButton8 = doc.getElementById('chpi');
  1286. var cityResultc8 = doc.getElementById('order_chpi');
  1287. showCityPickerButton8.addEventListener('tap', function(event) {
  1288. citycea.show(function(items) {
  1289. cityResultc8.value = items[0].text;
  1290. cityResultc8.setAttribute("data-index", items[0].value);
  1291. //返回 false 可以阻止选择框的关闭
  1292. //return false;
  1293. });
  1294. }, false);
  1295. //投诉产品名称
  1296. var lett = new $.PopPicker();
  1297. lett.setData(letter);
  1298. var showCityPickerButton2 = doc.getElementById('produ');
  1299. var cityResultc2 = doc.getElementById('order_product');
  1300. showCityPickerButton2.addEventListener('tap', function(event) {
  1301. lett.show(function(items) {
  1302. cityResultc2.value = items[0].text;
  1303. cityResultc2.setAttribute("data-index", items[0].value);
  1304. //返回 false 可以阻止选择框的关闭
  1305. //return false;
  1306. });
  1307. }, false);
  1308. // //投诉重要级别
  1309. // var level = new $.PopPicker();
  1310. // level.setData(rank);
  1311. // var showCityPickerButton3 = doc.getElementById('rank');
  1312. // var cityResultc3 = doc.getElementById('order_rank');
  1313. // showCityPickerButton3.addEventListener('tap', function(event) {
  1314. // level.show(function(items) {
  1315. // cityResultc3.value = items[0].text;
  1316. // cityResultc3.setAttribute("data-index", items[0].value);
  1317. // //返回 false 可以阻止选择框的关闭
  1318. // //return false;
  1319. // });
  1320. // }, false);
  1321. //抽检抽检级别
  1322. var spott = new $.PopPicker();
  1323. spott.setData(check);
  1324. var showCityPickerButton4 = doc.getElementById('samp');
  1325. var cityResultc4 = doc.getElementById('order_samplingle');
  1326. showCityPickerButton4.addEventListener('tap', function(event) {
  1327. spott.show(function(items) {
  1328. cityResultc4.value = items[0].text;
  1329. cityResultc4.setAttribute("data-index", items[0].value);
  1330. //返回 false 可以阻止选择框的关闭
  1331. //return false;
  1332. });
  1333. }, false);
  1334. //抽检抽检单位
  1335. var unit = new $.PopPicker();
  1336. unit.setData(monad);
  1337. var showCityPick5 = doc.getElementById('ling');
  1338. var cityResultc5 = doc.getElementById('order_lingunit');
  1339. showCityPick5.addEventListener('tap', function(event) {
  1340. unit.show(function(items) {
  1341. cityResultc5.value = items[0].text;
  1342. cityResultc5.setAttribute("data-index", items[0].value);
  1343. //返回 false 可以阻止选择框的关闭
  1344. //return false;
  1345. });
  1346. }, false);
  1347. var manager = new $.PopPicker({
  1348. F_Layer: 1,
  1349. });
  1350. manager.setData(lisboa);
  1351. var RCs5 = doc.getElementById('qregion');
  1352. var RCResults5 = doc.getElementById('order_macrocell');
  1353. RCs5.addEventListener('tap', function(event) {
  1354. manager.show(function(items) {
  1355. console.log(items[0].text)
  1356. RCResults5.value =items[0].text
  1357. RCResults5.setAttribute("data-index", items[0].text);
  1358. //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
  1359. //RCResults.setAttribute("data-index", items[0].id);
  1360. //返回 false 可以阻止选择框的关闭
  1361. //return false;
  1362. });
  1363. }, false);
  1364. //分公司
  1365. company = new $.PopPicker({
  1366. F_Layer: 2,
  1367. });
  1368. var RCs4 = doc.getElementById('filial');
  1369. var RCResults8 = doc.getElementById('order_branch');
  1370. RCs4.addEventListener('tap', function(event) {
  1371. fengong();
  1372. company.show(function(items) {
  1373. RCResults8.value =items[0].text
  1374. RCResults8.setAttribute("data-index", items[0].text);
  1375. //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
  1376. //RCResults.setAttribute("data-index", items[0].id);
  1377. //返回 false 可以阻止选择框的关闭
  1378. //return false;
  1379. });
  1380. }, false);
  1381. //投诉问题类别1
  1382. var complai = new $.PopPicker({
  1383. pid:0,
  1384. });
  1385. complai.setData(complaints);
  1386. var RCs12 = doc.getElementById('quest');
  1387. var RCResults12 = doc.getElementById('order_cat');
  1388. RCs12.addEventListener('tap', function(event) {
  1389. complai.show(function(items) {
  1390. console.log(items[0].text)
  1391. RCResults12.value =items[0].text
  1392. RCResults12.setAttribute("data-index", items[0].value);
  1393. //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
  1394. //RCResults.setAttribute("data-index", items[0].id);
  1395. //返回 false 可以阻止选择框的关闭
  1396. //return false;
  1397. });
  1398. }, false);
  1399. //问题类别2
  1400. com = new $.PopPicker({
  1401. pid:1,
  1402. });
  1403. console.log()
  1404. var RCs13= doc.getElementById('que');
  1405. var RCResults13 = doc.getElementById('order_question');
  1406. RCs13.addEventListener('tap', function(event) {
  1407. range();
  1408. com.show(function(items) {
  1409. RCResults13.value =items[0].text
  1410. RCResults13.setAttribute("data-index", items[0].value);
  1411. //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
  1412. //RCResults.setAttribute("data-index", items[0].id);
  1413. //返回 false 可以阻止选择框的关闭
  1414. //return false;
  1415. });
  1416. }, false);
  1417. //问题类别3
  1418. since = new $.PopPicker({
  1419. pid:1,
  1420. });
  1421. var RCs14= doc.getElementById('matter');
  1422. var RCResults14 = doc.getElementById('order_matter');
  1423. var RCResults144 = doc.getElementById('order_prer');
  1424. RCs14.addEventListener('tap', function(event) {
  1425. which();
  1426. since.show(function(items) {
  1427. RCResults144.value =items[0].text
  1428. RCResults14.value = items[0].value
  1429. RCResults14.setAttribute("data-index", items[0].value);
  1430. //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
  1431. //RCResults.setAttribute("data-index", items[0].id);
  1432. //返回 false 可以阻止选择框的关闭
  1433. //return false;
  1434. });
  1435. }, false);
  1436. })
  1437. })(mui, document);
  1438. })
  1439. $("#order_productname").click(function(){
  1440. })
  1441. $('#order_productname').find('input[data-index=""]').on('change', function() {
  1442. if($(this).val() == "624") { //业务办理
  1443. $('#qtqcr').show();
  1444. }else{
  1445. $('#qtqcr').hide();
  1446. }
  1447. });
  1448. $('#order_coding').blur(function () {
  1449. // alert($(this).val());
  1450. // $('#material').show();
  1451. if($(this).val()==''){
  1452. $('#tianxie').show();
  1453. $('#xiangqingm').hide();
  1454. }else {
  1455. $('#tianxie').hide();
  1456. $('#xiangqingm').show();
  1457. }
  1458. //根据客户编号获取信息
  1459. $.ajax({
  1460. url: huayi.config.callcenter_url + 'CustomerNew/GetCodeCustomer',
  1461. data: {
  1462. code:$('#order_coding').val(),
  1463. OpenId: openid, //微信openid,
  1464. },
  1465. async: true,
  1466. dataType: 'json',
  1467. type: 'get', //HTTP请求类型
  1468. success: function(data) {
  1469. if(data.state.toLowerCase() == "success") {
  1470. var result = data.data;
  1471. $('#order_yewu').val(result.F_Salesman);
  1472. $('#order_yewuphone').val(result.F_SalesPhone);
  1473. $('#order_macrocell').val(result.F_AreaName);
  1474. $('#order_branch').val(result.F_BranchName);
  1475. $('#order_pinpai').val(result.F_Brands);
  1476. $('#channel_type').val(result.F_Channel);//渠道类型
  1477. }
  1478. },
  1479. error: function(xhr, type, errorThrown) {
  1480. //异常处理;
  1481. }
  1482. })
  1483. });
  1484. $('#order_material').blur(function () {
  1485. // alert($(this).val());
  1486. // $('#material').show();
  1487. if($(this).val()==''){
  1488. $('#wuliaotian').show();
  1489. $('#wuliao').hide();
  1490. }else {
  1491. $('#wuliaotian').hide();
  1492. $('#wuliao').show();
  1493. }
  1494. //根据物料编码获取信息
  1495. $.ajax({
  1496. url: huayi.config.callcenter_url + 'MaterialManage/GetCodeModel',
  1497. data: {
  1498. code:$('#order_material').val(),
  1499. OpenId: openid, //微信openid,
  1500. },
  1501. async: true,
  1502. dataType: 'json',
  1503. type: 'get', //
  1504. success: function(data) {
  1505. if(data.state.toLowerCase() == "success") {
  1506. var result = data.data;
  1507. $("#order_mingcheng").val(result.model.F_MaterialName);//物料名称
  1508. $("#order_xinghao").val(result.model.F_Model),//型号
  1509. $("#order_guige").val(result.model.F_Specs);//规格
  1510. $("#order_yiji").val(result.model.F_Level1);//一级分类
  1511. $("#order_erji").val(result.model.F_Level2);//二级分类
  1512. $("#order_sanji").val(result.model.F_Level3);//三级分类
  1513. $('#order_pinpa').val(result.model.F_Brand);//品牌
  1514. $('#order_fuhefei').val(result.model.F_MaterialEffect); //复合肥肥效
  1515. $('#order_chanpinxian').val(result.model.F_Pipeline); //产品线tensions
  1516. $("#order_gongyi").val(result.model.F_Craft);//工艺
  1517. }
  1518. },
  1519. error: function(xhr, type, errorThrown) {
  1520. //异常处理;
  1521. }
  1522. })
  1523. });