Brak opisu

AddWorkolder.js 40KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505
  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').attr('data-index');//问题类别
  89. comdi = $('#order_productname').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 = '';
  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").attr('data-index');
  114. shengch=$('#order_batch').val();//生产批次号
  115. stion = $('#order_Claimnumber').val();//问题数量
  116. coint=$('#ower_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 = $('#order_wentlb').attr('data-index');
  123. cttt='';
  124. comdi ='';
  125. coint='';
  126. stion='';
  127. }else if(orderIsover === '4'){
  128. catt = $('#order_texta').attr('data-index');//问题类别
  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 + 'WorkOrder/GetQuestionNameType',
  673. async: false,
  674. data: {
  675. type:3,
  676. },
  677. dataType: 'json',
  678. success: function(res) {
  679. if(res.state.toLowerCase() === "success") {
  680. res = res.data;
  681. console.log(res)
  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. ke.push(obj);
  688. });
  689. // cityPicker5.setData(recive);
  690. }
  691. }
  692. }
  693. });
  694. //抽检问题类别
  695. var kees = [];
  696. $.ajax({
  697. type: "get",
  698. url: huayi.config.callcenter_url + 'WorkOrder/GetQuestionNameType',
  699. async: false,
  700. data: {
  701. type:2,
  702. },
  703. dataType: 'json',
  704. success: function(res) {
  705. if(res.state.toLowerCase() === "success") {
  706. res = res.data;
  707. console.log(res)
  708. if(res && res.length > 0) {
  709. res.forEach(function(v, i) {
  710. var obj = {};
  711. obj.value = v.id;
  712. obj.text = v.text;
  713. kees.push(obj);
  714. });
  715. // cityPicker5.setData(recive);
  716. }
  717. }
  718. }
  719. });
  720. //产品名称
  721. var keee = [];
  722. $.ajax({
  723. type: "get",
  724. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  725. async: false,
  726. data: {
  727. flag: 'CPZL'
  728. },
  729. dataType: 'json',
  730. success: function(data) {
  731. var key_data = data.data;
  732. // console.log(key_data);
  733. $(key_data).each(function(i, n) {
  734. var obj = {};
  735. obj.value = n.F_DictionaryValueId;
  736. obj.text = n.F_Name;
  737. keee.push(obj)
  738. // console.log(ke);
  739. })
  740. }
  741. });
  742. //投诉产品名称
  743. var letter = [];
  744. $.ajax({
  745. type: "get",
  746. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  747. async: false,
  748. data: {
  749. flag: 'CPZL'
  750. },
  751. dataType: 'json',
  752. success: function(data) {
  753. var key_data = data.data;
  754. $(key_data).each(function(i, n) {
  755. var obj = {};
  756. obj.value = n.F_DictionaryValueId;
  757. obj.text = n.F_Name;
  758. letter.push(obj)
  759. })
  760. }
  761. });
  762. //投诉重要级别
  763. var rank = [];
  764. $.ajax({
  765. type: "get",
  766. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  767. async: false,
  768. data: {
  769. flag: 'ZYJB'
  770. },
  771. dataType: 'json',
  772. success: function(data) {
  773. var key_data = data.data;
  774. // console.log(key_data);
  775. $(key_data).each(function(i, n) {
  776. var obj = {};
  777. obj.value = n.F_DictionaryValueId;
  778. obj.text = n.F_Name;
  779. rank.push(obj)
  780. // console.log(ke);
  781. })
  782. }
  783. });
  784. //抽检抽检级别
  785. var check = [];
  786. $.ajax({
  787. type: "get",
  788. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  789. async: false,
  790. data: {
  791. flag: 'CJJP'
  792. },
  793. dataType: 'json',
  794. success: function(data) {
  795. var key_data = data.data;
  796. // console.log(key_data);
  797. $(key_data).each(function(i, n) {
  798. var obj = {};
  799. obj.value = n.F_DictionaryValueId;
  800. obj.text = n.F_Name;
  801. check.push(obj)
  802. })
  803. }
  804. });
  805. //抽检抽检单位
  806. var monad = [];
  807. $.ajax({
  808. type: "get",
  809. url: huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlagWx',
  810. async: false,
  811. data: {
  812. flag: 'CJDW'
  813. },
  814. dataType: 'json',
  815. success: function(data) {
  816. var key_data = data.data;
  817. // console.log(key_data);
  818. $(key_data).each(function(i, n) {
  819. var obj = {};
  820. obj.value = n.F_DictionaryValueId;
  821. obj.text = n.F_Name;
  822. monad.push(obj)
  823. })
  824. }
  825. });
  826. //大区
  827. var lisboa = [];
  828. $.ajax({
  829. type: "get",
  830. url: huayi.config.callcenter_url + 'Department/GetList',
  831. async: false,
  832. data: {
  833. F_Layer: 1,
  834. },
  835. dataType: 'json',
  836. success: function(res) {
  837. if(res.state.toLowerCase() === "success") {
  838. res = res.data;
  839. console.log(res)
  840. if(res && res.length > 0) {
  841. res.forEach(function(v, i) {
  842. var obj = {};
  843. obj.value = v.F_DeptId;
  844. obj.text = v.F_DeptName;
  845. lisboa.push(obj);
  846. });
  847. console.log(lisboa)
  848. // cityPicker5.setData(recive);
  849. }
  850. }
  851. //recive = res.data;
  852. //console.log(recive)
  853. //alert(JSON.stringify(data));
  854. }
  855. });
  856. //分公司
  857. function fengong(){
  858. var filiale = []
  859. $.ajax({
  860. url: huayi.config.callcenter_url + 'Department/GetList',
  861. type: 'get',
  862. data: {
  863. F_Layer:2,
  864. F_RegionName: $('#order_macrocell').attr('data-index'),
  865. },
  866. dataType: "json",
  867. async: true,
  868. success: function(res) {
  869. if(res.state.toLowerCase() === "success") {
  870. res = res.data;
  871. console.log(res)
  872. if(res && res.length >0) {
  873. res.forEach(function(v, i) {
  874. var obj = {};
  875. obj.value = v.F_DeptId;
  876. obj.text = v.F_DeptName;
  877. filiale.push(obj);
  878. //$('<option value="' + v.F_UserId + '">' + v.F_UserName + '</option>').appendTo('#order_recive');
  879. });
  880. // console.log(vil)
  881. company.setData(filiale);
  882. }
  883. }
  884. },
  885. });
  886. }
  887. //投诉问题类别1
  888. var complaints = [];
  889. $.ajax({
  890. type: "get",
  891. url: huayi.config.callcenter_url + 'WorkOrder/GetQuestionNameType',
  892. async: false,
  893. data: {
  894. type:1,
  895. },
  896. dataType: 'json',
  897. success: function(res) {
  898. if(res.state.toLowerCase() === "success") {
  899. res = res.data;
  900. console.log(res)
  901. if(res && res.length > 0) {
  902. res.forEach(function(v, i) {
  903. var obj = {};
  904. obj.value = v.id;
  905. obj.text = v.text;
  906. complaints.push(obj);
  907. });
  908. // cityPicker5.setData(recive);
  909. }
  910. }
  911. //recive = res.data;
  912. //console.log(recive)
  913. //alert(JSON.stringify(data));
  914. }
  915. });
  916. //投诉问题类别2
  917. function range(){
  918. var more = []
  919. $.ajax({
  920. url: huayi.config.callcenter_url + 'WorkOrder/GetQuestionNameType',
  921. type: 'get',
  922. data: {
  923. QuestionName:$('#order_cat').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. console.log(res)
  932. if(res && res.length >0) {
  933. res.forEach(function(v, i) {
  934. var obj = {};
  935. obj.value = v.id;
  936. obj.text = v.text;
  937. more .push(obj);
  938. // $('<option value="' + v.id + '">' + v.text + '</option>').appendTo('#order_recive');
  939. });
  940. // console.log(more)
  941. com.setData(more);
  942. }
  943. }
  944. },
  945. });
  946. }
  947. //投诉问题类别3
  948. function which(){
  949. var vector = []
  950. $.ajax({
  951. url: huayi.config.callcenter_url + 'WorkOrder/GetQuestionNameType',
  952. type: 'get',
  953. data: {
  954. QuestionName:$('#order_question').val(),
  955. type:1,
  956. },
  957. dataType: "json",
  958. async: true,
  959. success: function(res) {
  960. if(res.state.toLowerCase() === "success") {
  961. res = res.data;
  962. console.log(res)
  963. if(res && res.length >0) {
  964. res.forEach(function(v, i) {
  965. var obj = {};
  966. obj.value = v.id;
  967. obj.text = v.text;
  968. vector .push(obj);
  969. // $('<option value="' + v.id + '">' + v.text + '</option>').appendTo('#order_recive');
  970. });
  971. // console.log(vector)
  972. since.setData(vector);
  973. }
  974. }
  975. },
  976. });
  977. }
  978. (function($, doc) {
  979. $.init();
  980. $.ready(function() {
  981. // 咨询 省
  982. var RCiP = new $.PopPicker({
  983. F_Layer: 1,
  984. });
  985. RCiP.setData(recives);
  986. var RCss1 = doc.getElementById('chouhuTi');
  987. var RCResultss = doc.getElementById('choworder_rengin');
  988. RCss1.addEventListener('tap', function(event) {
  989. RCiP.show(function(items) {
  990. console.log(items[0].text)
  991. RCResultss.value =items[0].text
  992. RCResultss.setAttribute("data-index", items[0].text);
  993. //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
  994. //RCResults.setAttribute("data-index", items[0].id);
  995. //返回 false 可以阻止选择框的关闭
  996. //return false;
  997. });
  998. }, false);
  999. //市
  1000. RCiPickee1 = new $.PopPicker({
  1001. F_Layer: 1,
  1002. });
  1003. var RCss2 = doc.getElementById('chowZhuTiPicker');
  1004. var RCResultss2 = doc.getElementById('shouorder_shi');
  1005. RCss2.addEventListener('tap', function(event) {
  1006. getRece();
  1007. RCiPickee1.show(function(items) {
  1008. RCResultss2.value =items[0].text
  1009. RCResultss2.setAttribute("data-index", items[0].text);
  1010. //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
  1011. //RCResults.setAttribute("data-index", items[0].id);
  1012. //返回 false 可以阻止选择框的关闭
  1013. //return false;
  1014. });
  1015. }, false);
  1016. //区/县
  1017. RCiPi1 = new $.PopPicker({
  1018. F_Layer: 1,
  1019. });
  1020. var RCs22 = doc.getElementById('chowcounty');
  1021. var RCResults22 = doc.getElementById('chouorder_xian');
  1022. RCs22.addEventListener('tap', function(event) {
  1023. getReee();
  1024. RCiPi1.show(function(items) {
  1025. RCResults22.value =items[0].text
  1026. RCResults22.setAttribute("data-index", items[0].text);
  1027. //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
  1028. //RCResults.setAttribute("data-index", items[0].id);
  1029. //返回 false 可以阻止选择框的关闭
  1030. //return false;
  1031. });
  1032. }, false);
  1033. //乡
  1034. RCi12 = new $.PopPicker({
  1035. F_Layer: 1,
  1036. });
  1037. var RCs33= doc.getElementById('chowtowns');
  1038. var RCResults33 = doc.getElementById('chouorder_xiang');
  1039. RCs33.addEventListener('tap', function(event) {
  1040. villagee();
  1041. RCi12.show(function(items) {
  1042. RCResults33.value =items[0].text
  1043. RCResults33.setAttribute("data-index", items[0].text);
  1044. //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
  1045. //RCResults.setAttribute("data-index", items[0].id);
  1046. //返回 false 可以阻止选择框的关闭
  1047. //return false;
  1048. });
  1049. }, false);
  1050. //销售基地
  1051. var cityPicker3 = new $.PopPicker();
  1052. cityPicker3.setData(keyList);
  1053. var showCityPickerButton = doc.getElementById('showCityPicker3');
  1054. var cityResult3 = doc.getElementById('ower_relationship');
  1055. showCityPickerButton.addEventListener('tap', function(event) {
  1056. cityPicker3.show(function(items) {
  1057. cityResult3.value = items[0].text;
  1058. cityResult3.setAttribute("data-index", items[0].value);
  1059. //返回 false 可以阻止选择框的关闭
  1060. //return false;
  1061. });
  1062. }, false);
  1063. //其他销售基地
  1064. var cityPicker9 = new $.PopPicker();
  1065. cityPicker9.setData(keyList);
  1066. var showCityPickerButton9 = doc.getElementById('showCpke');
  1067. var cityResult9 = doc.getElementById('ower_showCpke');
  1068. showCityPickerButton9.addEventListener('tap', function(event) {
  1069. cityPicker9.show(function(items) {
  1070. cityResult9.value = items[0].text;
  1071. cityResult9.setAttribute("data-index", items[0].value);
  1072. //返回 false 可以阻止选择框的关闭
  1073. //return false;
  1074. });
  1075. }, false);
  1076. //投诉销售基地
  1077. var cityPicker4 = new $.PopPicker();
  1078. cityPicker4.setData(keyList);
  1079. var showCityPickerButton4 = doc.getElementById('Sales_base');
  1080. var cityResult4 = doc.getElementById('ower_Sales_base');
  1081. showCityPickerButton4.addEventListener('tap', function(event) {
  1082. cityPicker3.show(function(items) {
  1083. cityResult4.value = items[0].text;
  1084. cityResult4.setAttribute("data-index", items[0].value);
  1085. //返回 false 可以阻止选择框的关闭
  1086. //return false;
  1087. });
  1088. }, false);
  1089. //问题类别
  1090. var city = new $.PopPicker();
  1091. city.setData(ke);
  1092. var showCityPickerButton = doc.getElementById('question');
  1093. var cityResult = doc.getElementById('order_category');
  1094. showCityPickerButton.addEventListener('tap', function(event) {
  1095. city.show(function(items) {
  1096. cityResult.value = items[0].text;
  1097. cityResult.setAttribute("data-index", items[0].value);
  1098. //返回 false 可以阻止选择框的关闭
  1099. //return false;
  1100. });
  1101. }, false);
  1102. //抽检问题类别
  1103. var cityes = new $.PopPicker();
  1104. cityes.setData(kees);
  1105. var showCityPickerButton6 = doc.getElementById('wentilb');
  1106. var cityResult6 = doc.getElementById('order_wentlb');
  1107. showCityPickerButton6.addEventListener('tap', function(event) {
  1108. cityes.show(function(items) {
  1109. cityResult6.value = items[0].text;
  1110. cityResult6.setAttribute("data-index", items[0].value);
  1111. //返回 false 可以阻止选择框的关闭
  1112. //return false;
  1113. });
  1114. }, false);
  1115. //其他问题类别
  1116. var citytt = new $.PopPicker();
  1117. citytt.setData(ke);
  1118. var showCityPickerButton7 = doc.getElementById('texta');
  1119. var cityResult7 = doc.getElementById('order_texta');
  1120. showCityPickerButton7.addEventListener('tap', function(event) {
  1121. citytt.show(function(items) {
  1122. cityResult7.value = items[0].text;
  1123. cityResult7.setAttribute("data-index", items[0].value);
  1124. //返回 false 可以阻止选择框的关闭
  1125. //return false;
  1126. });
  1127. }, false);
  1128. // //游客渠道类型
  1129. // var citye = new $.PopPicker();
  1130. // citye.setData(annel);
  1131. // var showCityPickerButt = doc.getElementById('trench');
  1132. // var cityResultion = doc.getElementById('manager');
  1133. // showCityPickerButt.addEventListener('tap', function(event) {
  1134. // citye.show(function(items) {
  1135. // cityResultion.value = items[0].text;
  1136. // cityResultion.setAttribute("data-index", items[0].value);
  1137. // //返回 false 可以阻止选择框的关闭
  1138. // //return false;
  1139. // });
  1140. // }, false);
  1141. //产品名称
  1142. var cityc = new $.PopPicker();
  1143. cityc.setData(keee);
  1144. var showCityPickerButton1 = doc.getElementById('product');
  1145. var cityResultc1 = doc.getElementById('order_productname');
  1146. showCityPickerButton1.addEventListener('tap', function(event) {
  1147. cityc.show(function(items) {
  1148. cityResultc1.value = items[0].text;
  1149. cityResultc1.setAttribute("data-index", items[0].value);
  1150. //返回 false 可以阻止选择框的关闭
  1151. //return false;
  1152. });
  1153. }, false);
  1154. //其他产品名称
  1155. var citycea = new $.PopPicker();
  1156. citycea.setData(keee);
  1157. var showCityPickerButton8 = doc.getElementById('chpi');
  1158. var cityResultc8 = doc.getElementById('order_chpi');
  1159. showCityPickerButton8.addEventListener('tap', function(event) {
  1160. citycea.show(function(items) {
  1161. cityResultc8.value = items[0].text;
  1162. cityResultc8.setAttribute("data-index", items[0].value);
  1163. //返回 false 可以阻止选择框的关闭
  1164. //return false;
  1165. });
  1166. }, false);
  1167. //投诉产品名称
  1168. var lett = new $.PopPicker();
  1169. lett.setData(letter);
  1170. var showCityPickerButton2 = doc.getElementById('produ');
  1171. var cityResultc2 = doc.getElementById('order_product');
  1172. showCityPickerButton2.addEventListener('tap', function(event) {
  1173. lett.show(function(items) {
  1174. cityResultc2.value = items[0].text;
  1175. cityResultc2.setAttribute("data-index", items[0].value);
  1176. //返回 false 可以阻止选择框的关闭
  1177. //return false;
  1178. });
  1179. }, false);
  1180. //投诉重要级别
  1181. var level = new $.PopPicker();
  1182. level.setData(rank);
  1183. var showCityPickerButton3 = doc.getElementById('rank');
  1184. var cityResultc3 = doc.getElementById('order_rank');
  1185. showCityPickerButton3.addEventListener('tap', function(event) {
  1186. level.show(function(items) {
  1187. cityResultc3.value = items[0].text;
  1188. cityResultc3.setAttribute("data-index", items[0].value);
  1189. //返回 false 可以阻止选择框的关闭
  1190. //return false;
  1191. });
  1192. }, false);
  1193. //抽检抽检级别
  1194. var spott = new $.PopPicker();
  1195. spott.setData(check);
  1196. var showCityPickerButton4 = doc.getElementById('samp');
  1197. var cityResultc4 = doc.getElementById('order_samplingle');
  1198. showCityPickerButton4.addEventListener('tap', function(event) {
  1199. spott.show(function(items) {
  1200. cityResultc4.value = items[0].text;
  1201. cityResultc4.setAttribute("data-index", items[0].value);
  1202. //返回 false 可以阻止选择框的关闭
  1203. //return false;
  1204. });
  1205. }, false);
  1206. //抽检抽检单位
  1207. var unit = new $.PopPicker();
  1208. unit.setData(monad);
  1209. var showCityPick5 = doc.getElementById('ling');
  1210. var cityResultc5 = doc.getElementById('order_lingunit');
  1211. showCityPick5.addEventListener('tap', function(event) {
  1212. unit.show(function(items) {
  1213. cityResultc5.value = items[0].text;
  1214. cityResultc5.setAttribute("data-index", items[0].value);
  1215. //返回 false 可以阻止选择框的关闭
  1216. //return false;
  1217. });
  1218. }, false);
  1219. var manager = new $.PopPicker({
  1220. F_Layer: 1,
  1221. });
  1222. manager.setData(lisboa);
  1223. var RCs5 = doc.getElementById('qregion');
  1224. var RCResults5 = doc.getElementById('order_macrocell');
  1225. RCs5.addEventListener('tap', function(event) {
  1226. manager.show(function(items) {
  1227. console.log(items[0].text)
  1228. RCResults5.value =items[0].text
  1229. RCResults5.setAttribute("data-index", items[0].text);
  1230. //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
  1231. //RCResults.setAttribute("data-index", items[0].id);
  1232. //返回 false 可以阻止选择框的关闭
  1233. //return false;
  1234. });
  1235. }, false);
  1236. //分公司
  1237. company = new $.PopPicker({
  1238. F_Layer: 2,
  1239. });
  1240. var RCs4 = doc.getElementById('filial');
  1241. var RCResults8 = doc.getElementById('order_branch');
  1242. RCs4.addEventListener('tap', function(event) {
  1243. fengong();
  1244. company.show(function(items) {
  1245. RCResults8.value =items[0].text
  1246. RCResults8.setAttribute("data-index", items[0].text);
  1247. //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
  1248. //RCResults.setAttribute("data-index", items[0].id);
  1249. //返回 false 可以阻止选择框的关闭
  1250. //return false;
  1251. });
  1252. }, false);
  1253. //投诉问题类别1
  1254. var complai = new $.PopPicker({
  1255. pid:0,
  1256. });
  1257. complai.setData(complaints);
  1258. var RCs12 = doc.getElementById('quest');
  1259. var RCResults12 = doc.getElementById('order_cat');
  1260. RCs12.addEventListener('tap', function(event) {
  1261. complai.show(function(items) {
  1262. console.log(items[0].text)
  1263. RCResults12.value =items[0].text
  1264. RCResults12.setAttribute("data-index", items[0].value);
  1265. //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
  1266. //RCResults.setAttribute("data-index", items[0].id);
  1267. //返回 false 可以阻止选择框的关闭
  1268. //return false;
  1269. });
  1270. }, false);
  1271. //问题类别2
  1272. com = new $.PopPicker({
  1273. pid:1,
  1274. });
  1275. console.log()
  1276. var RCs13= doc.getElementById('que');
  1277. var RCResults13 = doc.getElementById('order_question');
  1278. RCs13.addEventListener('tap', function(event) {
  1279. range();
  1280. com.show(function(items) {
  1281. RCResults13.value =items[0].text
  1282. RCResults13.setAttribute("data-index", items[0].value);
  1283. //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
  1284. //RCResults.setAttribute("data-index", items[0].id);
  1285. //返回 false 可以阻止选择框的关闭
  1286. //return false;
  1287. });
  1288. }, false);
  1289. //问题类别3
  1290. since = new $.PopPicker({
  1291. pid:1,
  1292. });
  1293. var RCs14= doc.getElementById('matter');
  1294. var RCResults14 = doc.getElementById('order_matter');
  1295. RCs14.addEventListener('tap', function(event) {
  1296. which();
  1297. since.show(function(items) {
  1298. RCResults14.value =items[0].text
  1299. RCResults14.setAttribute("data-index", items[0].value);
  1300. //RCResults.value =items[0].text + "-" + items[1].text + "-" + items[2].text;
  1301. //RCResults.setAttribute("data-index", items[0].id);
  1302. //返回 false 可以阻止选择框的关闭
  1303. //return false;
  1304. });
  1305. }, false);
  1306. })
  1307. })(mui, document);
  1308. })
  1309. $("#order_productname").click(function(){
  1310. })
  1311. $('#order_productname').find('input[data-index=""]').on('change', function() {
  1312. if($(this).val() == "624") { //业务办理
  1313. $('#qtqcr').show();
  1314. }else{
  1315. $('#qtqcr').hide();
  1316. }
  1317. });
  1318. $('#order_coding').blur(function () {
  1319. // alert($(this).val());
  1320. // $('#material').show();
  1321. if($(this).val()==''){
  1322. $('#tianxie').show();
  1323. $('#xiangqingm').hide();
  1324. }else {
  1325. $('#tianxie').hide();
  1326. $('#xiangqingm').show();
  1327. }
  1328. //根据客户编号获取信息
  1329. $.ajax({
  1330. url: huayi.config.callcenter_url + 'CustomerNew/GetCodeCustomer',
  1331. data: {
  1332. code:$('#order_coding').val(),
  1333. OpenId: openid, //微信openid,
  1334. },
  1335. async: true,
  1336. dataType: 'json',
  1337. type: 'get', //HTTP请求类型
  1338. success: function(data) {
  1339. if(data.state.toLowerCase() == "success") {
  1340. var result = data.data;
  1341. $('#order_yewu').val(result.F_Salesman);
  1342. $('#order_yewuphone').val(result.F_SalesPhone);
  1343. $('#order_macrocell').val(result.F_AreaName);
  1344. $('#order_branch').val(result.F_BranchName);
  1345. $('#order_pinpai').val(result.F_Brands);
  1346. }
  1347. },
  1348. error: function(xhr, type, errorThrown) {
  1349. //异常处理;
  1350. }
  1351. })
  1352. });
  1353. $('#order_material').blur(function () {
  1354. // alert($(this).val());
  1355. // $('#material').show();
  1356. if($(this).val()==''){
  1357. $('#wuliaotian').show();
  1358. $('#wuliao').hide();
  1359. }else {
  1360. $('#wuliaotian').hide();
  1361. $('#wuliao').show();
  1362. }
  1363. //根据物料编码获取信息
  1364. $.ajax({
  1365. url: huayi.config.callcenter_url + 'MaterialManage/GetCodeModel',
  1366. data: {
  1367. code:$('#order_material').val(),
  1368. OpenId: openid, //微信openid,
  1369. },
  1370. async: true,
  1371. dataType: 'json',
  1372. type: 'get', //
  1373. success: function(data) {
  1374. if(data.state.toLowerCase() == "success") {
  1375. var result = data.data;
  1376. $("#order_mingcheng").val(result.model.F_MaterialName);//物料名称
  1377. $("#order_xinghao").val(result.model.F_Model),//型号
  1378. $("#order_guige").val(result.model.F_Specs);//规格
  1379. $("#order_yiji").val(result.model.F_Level1);//一级分类
  1380. $("#order_erji").val(result.model.F_Level2);//二级分类
  1381. $("#order_sanji").val(result.model.F_Level3);//三级分类
  1382. $('#order_pinpa').val(result.model.F_Brand);//品牌
  1383. $('#order_fuhefei').val(result.model.F_MaterialEffect); //复合肥肥效
  1384. $('#order_chanpinxian').val(result.model.F_Pipeline); //产品线tensions
  1385. $("#order_gongyi").val(result.model.F_Craft);//工艺
  1386. }
  1387. },
  1388. error: function(xhr, type, errorThrown) {
  1389. //异常处理;
  1390. }
  1391. })
  1392. });