Нет описания

AddWorkolder.js 41KB

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