Keine Beschreibung

editWorkolder.js 48KB

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