Brak opisu

AddWorkolder.js 43KB

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