Keine Beschreibung

editWorkolder.js 50KB

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