Нет описания

AddWorkolder.js 42KB

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