Ei kuvausta

AddWorkolder.js 39KB

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