Keine Beschreibung

addOrEditWorkOrder.js 36KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090
  1. /**
  2. * 修改工单
  3. * */
  4. //获取 id
  5. var oid = helper.request.queryString("oid");
  6. $(function() {
  7. autosize($('textarea'));
  8. //获取工单来源 获取业务办理 获取工单类型
  9. $.when(helper.getDropList.getlistDropByDic($('#order_source'), 'GDLY'),
  10. helper.getDropList.getlistDropByDic($('#order_handle'), 'YWLX'),
  11. helper.getDropList.getOrderRadios($('#order_type'), 'GDLX', 'inlineRadioOptions'))
  12. .then(function(){
  13. if(oid) {
  14. getWorkOrderDetails(oid); //获取工单信息
  15. }
  16. });
  17. //工单有效性
  18. $('#order_iseffective').find('input[type="radio"]').on('change', function() {
  19. //是否有效工单项(0有效,1无效)
  20. if($(this).val() === "1") { //无效
  21. $('.order_note').show();
  22. } else {
  23. $('.order_note').hide();
  24. }
  25. });
  26. //新增工单创建
  27. $('#save_order').on('click', orderSave);
  28. });
  29. function clearInter() {
  30. clearInterval(timer);
  31. }
  32. var callId = helper.request.queryString("cid");
  33. // $(function() {
  34. //
  35. // autosize($('textarea'));
  36. // getWorkOrderDetails()
  37. //
  38. $('#save_order').click(function(){//ID为test的元素点击时
  39. orderSave();
  40. });
  41. // // 指派按钮
  42. // $('#save_vsv').click(function(){//ID为test的元素点击时
  43. // dealWorkOrder();
  44. // });
  45. // $('#empty').click(function(){//ID为test的元素点击时
  46. // cleanOrde();
  47. // });
  48. // });
  49. //投诉和抽检客户 物料编号清空
  50. function emptyct(){
  51. $('#number').val('');
  52. $('#salesman').val('');
  53. $('#telephone').val('');
  54. $('#District').val('');
  55. $('#Branice').val('');
  56. $('#manage').val('');
  57. $('#Code').val('');
  58. $('#material_name').val('');
  59. $('#model_number').val('');
  60. $('#specifications').val('');
  61. $('#category1').val('');
  62. $('#category2').val('');
  63. $('#category3').val('');
  64. $('#brand_name').val('');
  65. $('#efficiency').val('');
  66. $('#product_line').val('');
  67. $('#process').val('');
  68. $('#enter_formula').val('');
  69. }
  70. var catt;//问题类别
  71. var cttt;//投诉问题类别
  72. var comdi;//产品名称
  73. var coint; //销售基地
  74. var stion; //问题数量
  75. var shengch; //生产批次号
  76. var jyppai;
  77. var daqu;
  78. var fengo;
  79. var orderIsover;
  80. function typePro(){
  81. orderIsover=$('input:radio[name="type"]:checked').val();
  82. if(orderIsover === '1'){
  83. debugger
  84. catt = $('#category').val();//问题类别
  85. comdi = $('#ProductName').val();//产品名称
  86. stion = $('#Product_Quantity').val();//问题数量
  87. coint=$('#xiaoshou').val();//销售基地
  88. daqu='';
  89. fengo='';
  90. jyppai='';
  91. cttt='';
  92. shengch='';
  93. emptyct()
  94. $('#wlbm').hide();
  95. $('#wlmcc').hide();
  96. $('#clie').hide();
  97. $('#mate').hide();
  98. }else if(orderIsover=== '2'){
  99. daqu=$('#chdaqu').val();
  100. fengo=$('#chfen').val();
  101. jyppai=$('#brand_name').val();
  102. comdi = $('#product_name').val();//产品名称
  103. cttt = $("#cate").val();
  104. // if($("#catego").val()){
  105. // cttt = $("#cat").val()+"|"+$("#catego").val();
  106. // if($("#cate").val()){
  107. // cttt = $("#cat").val()+"|"+$("#catego").val()+"|"+$("#cate").val();
  108. // }
  109. // }
  110. catt = $("#cate").val();
  111. shengch=$('#Batch_number').val();//生产批次号
  112. stion = $('#quantity').val();//问题数量
  113. coint=$('#Sales_base').val();//销售基地
  114. }else if(orderIsover === '3'){
  115. daqu=$('#District').val();
  116. fengo=$('#Branice').val();
  117. jyppai=$('#brand_name').val();
  118. shengch=$('#batch_num').val();//生产批次号
  119. catt = $('#chou_wtlb').val();
  120. // cttt=$('#chou_wtlb').val();
  121. comdi ='';
  122. coint='';
  123. stion='';
  124. }else if(orderIsover === '4'){
  125. catt = $('#cateq').val();//问题类别
  126. comdi = $('#Produ_ctName').val();//产品名称
  127. stion = $('#Product_Quantity').val();//问题数量
  128. coint=$('#xiaosh').val();//销售基地
  129. daqu='';
  130. fengo='';
  131. jyppai='';
  132. cttt='';
  133. shengch='';
  134. emptyct()
  135. $('#wlbm').hide();
  136. $('#wlmcc').hide();
  137. $('#clie').hide();
  138. $('#mate').hide();
  139. // alert(catt)
  140. }
  141. }
  142. // 保存
  143. function orderSave() {
  144. typePro();
  145. var wURL = '';
  146. var oid = '';
  147. oid = helper.request.queryString("oid");
  148. var isDetail = helper.request.queryString("isDetail");
  149. // if(!regexs.userNameReg.test($.trim($('#order_name').val()))) {
  150. // layer.confirm('请输入有效的客户姓名(2-20位汉字可以包含·•)!', {
  151. // icon: 2,
  152. // btn: ['确定']
  153. // });
  154. // return;
  155. // }
  156. //
  157. // if(!regexs.phone.test($.trim($('#order_tel').val()))) {
  158. // layer.confirm('请输入正确的电话!', {
  159. // icon: 2,
  160. // btn: ['确定']
  161. // });
  162. // return;
  163. // }
  164. var order_handle = $('#order_handles').is(':visible') ? $('#order_handle').val() : 0;
  165. $.post(huayi.config.callcenter_url + "WorkOrderNew/Update", {
  166. F_ID: oid, //int 工单id;
  167. F_Source:$('#godanlx').val(),//
  168. // F_CompanyName: $('#order_company').val(),// 公司名称
  169. F_Type: $('#order_isover').find('input[type="radio"]:checked').val(), //工单类型
  170. //公共字段
  171. F_CusName: $('#kehuxing').val(),//客户姓名
  172. F_CusPhone: $('#kehudian').val(),//客户电话
  173. F_IncidentProvince: $('#sheng').val(),//string 省
  174. F_IncidentCity: $('#shi').val(),// 市
  175. F_IncidentCountry: $('#quxian').val(),//区/县
  176. F_IncidentTownship: $('#xiang').val(),//乡
  177. F_IncidentDetailed: $('#xiangxi').val(),//详细地址
  178. F_Description: $('#reception').val(),//问题描述
  179. //咨询模块
  180. F_QuestionType:catt,//问题类别
  181. F_TS_Category: comdi,//产品名称
  182. F_ZX_Quantity: $('#Product_Quantity').val(),//问题数量
  183. F_SalesBase:coint,//销售基地
  184. //投诉模块
  185. F_BatchNumber:shengch,//生产批号
  186. F_TS_Formula: $('#formula').val(),//配方
  187. F_TS_Quantity:$('#quantity').val(),//问题数量(吨)
  188. F_TS_Level: $('#level').val(),//重要界别
  189. F_CustomerID: $('#number').val(),//客户编号
  190. F_Salesman: $('#salesman').val(),//业务员
  191. F_SalesPhone: $('#telephone').val(),//电话
  192. F_ZX_Area: $('#District').val(),//大区
  193. F_ZX_Branch: $('#Branice').val(),//分公司
  194. F_Brand: $('#manage').val(),//经营品牌
  195. F_MaterialID: $('#Code').val(),//客户编号
  196. F_CustomerID: $('#number').val(),//客户编号
  197. F_Model: $('#model_number').val(),//型号
  198. F_Specs: $('#specifications').val(),//规格
  199. F_Level1: $('#category1').val(),//一级分类
  200. F_Level2: $('#category2').val(),//二级分类
  201. F_Level3: $('#category3').val(),//三级分类
  202. F_Brand: $('#brand_name').val(),//品牌
  203. F_MaterialEffect: $('#efficiency').val(),//复合肥肥效
  204. F_Pipeline: $('#product_line').val(),//产品线
  205. F_Craft: $('#process').val(),//工艺
  206. F_Formula: $('#enter_formula').val(),//配方
  207. //抽检模块
  208. // F_CusName: $('#kxing').val(),//客户姓名
  209. // F_CusPhone: $('#kdian').val(),//客户电话
  210. // F_QuestionType:catt, //问题类别
  211. F_CJ_Time: $('#der_time').val(),//抽检时间
  212. F_CJ_Level: $('#der_level').val(),//抽检级别
  213. F_CJ_Unit: $('#der_Company').val(),//抽检单位
  214. F_CJ_TestUnit: $('#der_Test').val(),//化验单位
  215. F_CJ_Tonnage: $('#der_Tonnage').val(),//抽检吨数
  216. F_CJ_BagNo: $('#der_Ton').val(),//抽检袋数
  217. F_CJ_Outlay: $('#der_Amount').val(),//公关费用金额
  218. token: $.cookie("token")
  219. }, function(result) {
  220. result = $.parseJSON(result);
  221. if(result.state.toLowerCase() == "success") {
  222. if(isDetail === "true") {
  223. parent.parent.layer.closeAll();
  224. parent.parent.$('#derlist').bootstrapTable('refresh');
  225. parent.parent.layer.msg("修改成功");
  226. }
  227. else {
  228. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  229. parent.layer.close(index); //再执行关闭
  230. parent.$('#workorderlist').bootstrapTable('refresh');
  231. parent.$('.Closed').trigger('click');
  232. parent.layer.msg("保存成功");
  233. }
  234. top.workcount();
  235. }
  236. })
  237. }
  238. //获取工单详情
  239. function getWorkOrderDetails(oid) {
  240. $.getJSON(huayi.config.callcenter_url + 'WorkOrderNew/GetDetails', {
  241. id: oid,
  242. "token": $.cookie("token")
  243. }, function(result) {
  244. if(result.state.toLowerCase() == "success") {
  245. if(result.rows && result.rows.length > 0) {
  246. var data = result.rows[0];
  247. $("#lygon").text(data.F_SourceName);
  248. // 咨询模块
  249. $("#category option:selected").text(data.F_QuestionType);//问题类别
  250. $("#ProductName option:selected").text(data.F_ZX_ProName);//产品名称
  251. $('#Product_Quantity').val(data.F_ZX_Quantity);//问题数量
  252. $("#xiaoshou option:selected").text(data.F_SalesBase);//销售基地
  253. // 投诉模块
  254. $("#product_name option:selected").text(data.F_ZX_ProName);//产品名称
  255. $('#quantity').val(data.F_TS_Quantity);//问题数量
  256. $('#Batch_number').val();//生产批次
  257. $("#Sales_base option:selected").text(data.F_SalesBase);//销售基地
  258. $("#level option:selected").text(data.F_TS_Level);//重要级别
  259. $("#cat option:selected").text(data.F_QuestionTypeone);//问题类别1
  260. $("#catego option:selected").text(data.F_QuestionTypetwo);//问题类别2
  261. $("#cate option:selected").text(data.F_QuestionType);//问题类别3
  262. // 抽检模块
  263. $("#chou_wtlb option:selected").text(data.F_QuestionType);//问题类别
  264. $("#der_level option:selected").text(data.F_CJ_Level);//抽检级别
  265. $('#batch_num').val(data.F_SC_QualityMonth);//生产批次号
  266. $("#der_Company option:selected").text(data.F_CJ_Unit);//抽检单位
  267. $('#der_Test').val(data.F_CJ_TestUnit);//化验单位
  268. $('#der_Tonnage').val(data.F_CJ_Tonnage);//抽检吨数
  269. $('#der_Ton').val(data.F_CJ_BagNo);//抽检袋数
  270. $('#der_Amount').val(data.F_CJ_Outlay);//公关费用金额
  271. $('#der_time').val(data.F_CJ_Time);//抽检时间
  272. // 建议及其他
  273. $("#cateq option:selected").text(data.F_QuestionType);//问题类别
  274. $("#Produ_ctName option:selected").text(data.F_QuestionType);//产品名称
  275. $('#Product_Quan').val();//问题数量
  276. $("#xiaosh option:selected").text(data.F_SalesBase);//销售基地
  277. // 公共模块
  278. $('#number').val(data.F_CustomerID);//客户编码
  279. $('#salesman').val(data.F_Salesman);//业务员
  280. $('#telephone').val(data.F_SalesPhone);//电话
  281. $("#chdaqu option:selected").text(data.F_AreaName);//大区
  282. $("#chfen option:selected").text(data.F_BranchName);//分公司
  283. $('#manage').val();//经营品牌
  284. //物料
  285. $('#Code').val(data.F_MaterialID);//物料编码
  286. $('#material_name').val(data.F_MaterialName);//物料名称
  287. $('#model_number').val(data.F_Model);//型号
  288. $('#specifications').val(data.F_Specs);//规格
  289. $('#category1').val(data.F_Level1);//一级分类
  290. $('#category2').val(data.F_Level2);//二级分类
  291. $('#category3').val(data.F_Level3);//三级分类
  292. $('#brand_name').val(data.F_Brand);//品牌
  293. $('#efficiency').val(data.F_MaterialEffect);//复合肥肥效
  294. $('#product_line').val(data.F_Pipeline);//产品线
  295. $('#process').val(data.F_Craft);//工艺
  296. $('#enter_formula').val(data.F_TS_Formula);//配方
  297. $('#kehuxing').val(data.F_CusName);//客户姓名
  298. $('#kehudian').val(data.F_CusPhone);//客户电话
  299. $("#sheng option:selected").text(data.F_IncidentProvince);// 省
  300. $("#shi option:selected").text(data.F_IncidentCity);//市
  301. $("#quxian option:selected").text(data.F_IncidentCountry);//区县
  302. $("#xiang option:selected").text(data.F_IncidentTownship);//乡
  303. $("#xiangxi").val(data.F_IncidentDetailed);//详细
  304. $('#reception').val(data.F_Description);//问题描述
  305. if(data.F_TypeName === "咨询") {
  306. $('#PageArrival').show(); //receive
  307. $('#Duration').hide();
  308. $('#Depth').hide();
  309. $('#Page').hide();
  310. $('#wlbm').hide();
  311. $('#wlmcc').hide();
  312. } else if(data.F_TypeName === "投诉") {
  313. $('#PageArrival').hide(); //receive
  314. $('#Duration').show();
  315. $('#Depth').hide();
  316. $('#Page').hide();
  317. $('#wlbm').show();
  318. $('#wlmcc').show();
  319. }else if(data.F_TypeName === "抽检"){
  320. $('#PageArrival').hide(); //receive
  321. $('#Duration').hide();
  322. $('#Depth').show();
  323. $('#Page').hide();
  324. $('#wlbm').show();
  325. $('#wlmcc').show();
  326. }else if(data.F_TypeName === "建议及其他"){
  327. $('#PageArrival').hide(); //receive
  328. $('#Duration').hide();
  329. $('#Depth').hide();
  330. $('#Page').show();
  331. $('#wlbm').hide();
  332. $('#wlmcc').hide();
  333. }
  334. }
  335. }
  336. });
  337. }
  338. //三级联动下拉
  339. $(document).ready(function () {
  340. var wid = helper.request.queryString("wid");
  341. LY($("#sheng"));//省
  342. SHENG($("#shengji"));
  343. XSJD($("#xiaoshou"));//销售基地
  344. XSJD($("#xiaosh"));//建议及其他销售基地
  345. XSJD($("#Sales_base"));//建议及其他销售基地
  346. ZXWTLB($("#category")); //咨询问题类别
  347. // ZXWTLB($("#categg")); //问题类别
  348. ZXCPMC($("#ProductName"));
  349. // ZXCPMC($("#ProductName"));
  350. ZXCPMC($("#product_name"));
  351. ZXCPMC($("#Produ_ctName"));//建议及其他产品名称
  352. DQ($("#District"));
  353. //投诉模块
  354. WTLB1($("#cat"));//问题类型1
  355. CPZL($("#Product_Category"));//产品名称
  356. WTLBCJ($("#chou_wtlb"));//抽检问题类型
  357. ZYJB($("#level"));//重要级别
  358. CJJP($("#der_level"));//抽检级别
  359. CJDW($("#der_Company"));//抽检单位
  360. DQQ($("#customer_comaddress")); //大区
  361. QDLX($("#customer_taxPointDes"));//添加客户渠道类型
  362. QDLX($("#channel"));//来电弹屏渠道类型
  363. XYDJ($("#customer_invoiceRange"));
  364. JYPP($("#customer_Qualification"));
  365. JYPP($("#management"));
  366. CAPI($("#customer_FinancialManager"));
  367. YFPP($("#customer_feeEx"));
  368. YFPP($("#fertilizer"));
  369. });
  370. // 客户信息里的 省/市/区/县
  371. // 咨询模块 省
  372. function LY(obj) {
  373. obj.empty();
  374. obj.append('<option selected="selected" value="">请选择</option>');
  375. $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
  376. "token": $.cookie("token"),
  377. F_Layer: 1,
  378. }, function (data) {
  379. if (data.state.toLowerCase() == "success") {
  380. var content = data.data;
  381. $(content).each(function (i, n) {
  382. $("<option value='" + n.F_RegionName + "'>" + n.F_RegionName + "</option>").appendTo(obj);
  383. })
  384. }
  385. })
  386. }
  387. //市
  388. function LB(obj) {
  389. obj.empty();
  390. obj.append('<option selected="selected" value="">请选择</option>');
  391. $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
  392. "token": $.cookie("token"),
  393. F_Layer: 2,
  394. F_RegionName:$('#sheng').val()
  395. }, function (data) {
  396. if (data.state.toLowerCase() == "success") {
  397. var content = data.data;
  398. $(content).each(function (i, n) {
  399. $("<option value='" + n.F_RegionName + "'>" + n.F_RegionName + "</option>").appendTo(obj);
  400. })
  401. }
  402. })
  403. }
  404. // 区/县
  405. function ZT(obj) {
  406. obj.empty();
  407. obj.append('<option selected="selected" value="">请选择</option>');
  408. $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
  409. "token": $.cookie("token"),
  410. F_Layer: 3,
  411. F_RegionName:$('#shi').val()
  412. }, function (data) {
  413. if (data.state.toLowerCase() == "success") {
  414. var content = data.data;
  415. $(content).each(function (i, n) {
  416. $("<option value='" + n.F_RegionName + "'>" + n.F_RegionName + "</option>").appendTo(obj);
  417. })
  418. }
  419. })
  420. }
  421. // 乡
  422. function XX(obj) {
  423. obj.empty();
  424. obj.append('<option selected="selected" value="">请选择</option>');
  425. $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
  426. "token": $.cookie("token"),
  427. F_Layer: 4,
  428. F_RegionName:$('#quxian').val()
  429. }, function (data) {
  430. if (data.state.toLowerCase() == "success") {
  431. var content = data.data;
  432. $(content).each(function (i, n) {
  433. $("<option value='" + n.F_RegionName + "'>" + n.F_RegionName + "</option>").appendTo(obj);
  434. })
  435. }
  436. })
  437. }
  438. $('#sheng').on('change',function(){
  439. $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
  440. "token": $.cookie("token"),
  441. F_Layer: 2,
  442. F_RegionName:$('#sheng').val(),
  443. }, function (data) {
  444. if (data.state.toLowerCase() == "success") {
  445. var content = data.data;
  446. $(content).each(function (i, n) {
  447. $("<option value='" + n.F_RegionName + "'>" + n.F_RegionName + "</option>").appendTo("#shi");
  448. })
  449. LB($("#shi"));
  450. }
  451. })
  452. });
  453. $('#shi').on('change',function(){
  454. $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
  455. "token": $.cookie("token"),
  456. F_Layer: 3,
  457. F_RegionName:$('#shi').val()
  458. }, function (data) {
  459. if (data.state.toLowerCase() == "success") {
  460. var content = data.data;
  461. $(content).each(function (i, n) {
  462. $("<option value='" + n.F_RegionName + "'>" + n.F_RegionName + "</option>").appendTo("#quxian");
  463. })
  464. ZT($("#quxian"));
  465. }
  466. })
  467. });
  468. $('#quxian').on('change',function(){
  469. $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
  470. "token": $.cookie("token"),
  471. F_Layer: 4,
  472. F_RegionName:$('#quxian').val()
  473. }, function (data) {
  474. if (data.state.toLowerCase() == "success") {
  475. var content = data.data;
  476. $(content).each(function (i, n) {
  477. $("<option value='" + n.F_RegionName + "'>" + n.F_RegionName + "</option>").appendTo("#xiang");
  478. })
  479. XX($('#xiang'));
  480. }
  481. })
  482. });
  483. function SHENG(obj) {
  484. obj.empty();
  485. obj.append('<option selected="selected" value="">请选择</option>');
  486. $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
  487. "token": $.cookie("token"),
  488. F_Layer: 1,
  489. }, function (data) {
  490. if (data.state.toLowerCase() == "success") {
  491. var content = data.data;
  492. $(content).each(function (i, n) {
  493. $("<option value='" + n.F_RegionName + "'>" + n.F_RegionName + "</option>").appendTo(obj);
  494. })
  495. }
  496. })
  497. }
  498. //市
  499. function SHI(obj) {
  500. obj.empty();
  501. obj.append('<option selected="selected" value="">请选择</option>');
  502. $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
  503. "token": $.cookie("token"),
  504. F_Layer: 2,
  505. F_RegionName:$('#shengji').val()
  506. }, function (data) {
  507. if (data.state.toLowerCase() == "success") {
  508. var content = data.data;
  509. $(content).each(function (i, n) {
  510. $("<option value='" + n.F_RegionName + "'>" + n.F_RegionName + "</option>").appendTo(obj);
  511. })
  512. }
  513. })
  514. }
  515. // 区/县
  516. function QUXIAN(obj) {
  517. obj.empty();
  518. obj.append('<option selected="selected" value="">请选择</option>');
  519. $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
  520. "token": $.cookie("token"),
  521. F_Layer: 3,
  522. F_RegionName:$('#shiji').val()
  523. }, function (data) {
  524. if (data.state.toLowerCase() == "success") {
  525. var content = data.data;
  526. $(content).each(function (i, n) {
  527. $("<option value='" + n.F_RegionName + "'>" + n.F_RegionName + "</option>").appendTo(obj);
  528. })
  529. }
  530. })
  531. }
  532. // 乡
  533. function XIANG(obj) {
  534. obj.empty();
  535. obj.append('<option selected="selected" value="">请选择</option>');
  536. $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
  537. "token": $.cookie("token"),
  538. F_Layer: 4,
  539. F_RegionName:$('#quxianji').val()
  540. }, function (data) {
  541. if (data.state.toLowerCase() == "success") {
  542. var content = data.data;
  543. $(content).each(function (i, n) {
  544. $("<option value='" + n.F_RegionName + "'>" + n.F_RegionName + "</option>").appendTo(obj);
  545. })
  546. }
  547. })
  548. }
  549. $('#shengji').on('change',function(){
  550. $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
  551. "token": $.cookie("token"),
  552. F_Layer: 2,
  553. F_RegionName:$('#shengji').val(),
  554. }, function (data) {
  555. if (data.state.toLowerCase() == "success") {
  556. var content = data.data;
  557. $(content).each(function (i, n) {
  558. $("<option value='" + n.F_RegionName + "'>" + n.F_RegionName + "</option>").appendTo("#shiji");
  559. })
  560. SHI($("#shiji"));
  561. }
  562. })
  563. });
  564. $('#shiji').on('change',function(){
  565. $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
  566. "token": $.cookie("token"),
  567. F_Layer: 3,
  568. F_RegionName:$('#shiji').val()
  569. }, function (data) {
  570. if (data.state.toLowerCase() == "success") {
  571. var content = data.data;
  572. $(content).each(function (i, n) {
  573. $("<option value='" + n.F_RegionName + "'>" + n.F_RegionName + "</option>").appendTo("#quxianji");
  574. })
  575. QUXIAN($("#quxianji"));
  576. }
  577. })
  578. });
  579. $('#quxianji').on('change',function(){
  580. $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
  581. "token": $.cookie("token"),
  582. F_Layer: 4,
  583. F_RegionName:$('#quxianji').val()
  584. }, function (data) {
  585. if (data.state.toLowerCase() == "success") {
  586. var content = data.data;
  587. $(content).each(function (i, n) {
  588. $("<option value='" + n.F_RegionName + "'>" + n.F_RegionName + "</option>").appendTo("#xiangji");
  589. })
  590. XIANG($("#xiangji"));
  591. }
  592. })
  593. });
  594. //销售基地
  595. function XSJD(obj) {
  596. obj.empty();
  597. obj.append('<option selected="selected" value="">请选择</option>');
  598. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
  599. "token": $.cookie("token"),
  600. flag:"XSJD",
  601. }, function (data) {
  602. if (data.state.toLowerCase() == "success") {
  603. var content = data.data;
  604. $(content).each(function (i, n) {
  605. $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
  606. })
  607. }
  608. })
  609. }
  610. //问题类别
  611. function ZXWTLB(obj) {
  612. obj.empty();
  613. obj.append('<option selected="selected" value="">请选择</option>');
  614. $.getJSON(huayi.config.callcenter_url + "WorkOrder/GetQuestionNameType", {
  615. "token": $.cookie("token"),
  616. type: 3,
  617. // pid:0,
  618. }, function (data) {
  619. if (data.state.toLowerCase() == "success") {
  620. var content = data.data;
  621. $(content).each(function (i, n) {
  622. $("<option value='" + n.id + "'>" + n.text + "</option>").appendTo(obj);
  623. })
  624. }
  625. })
  626. }
  627. function ZXCPMC(obj) {
  628. obj.empty();
  629. obj.append('<option selected="selected" value="">请选择</option>');
  630. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
  631. "token": $.cookie("token"),
  632. flag:"CPZL",
  633. }, function (data) {
  634. if (data.state.toLowerCase() == "success") {
  635. var content = data.data;
  636. $(content).each(function (i, n) {
  637. $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
  638. })
  639. }
  640. })
  641. }
  642. function DQ(obj) {
  643. obj.empty();
  644. obj.append('<option selected="selected" value="">请选择</option>');
  645. $.getJSON(huayi.config.callcenter_url + "Department/GetList", {
  646. "token": $.cookie("token"),
  647. F_Layer: 1,
  648. }, function (data) {
  649. if (data.state.toLowerCase() == "success") {
  650. var content = data.data;
  651. $(content).each(function (i, n) {
  652. $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(obj);
  653. })
  654. }
  655. })
  656. }
  657. function FENGONGSI(obj) {
  658. obj.empty();
  659. obj.append('<option selected="selected" value="">请选择</option>');
  660. $.getJSON(huayi.config.callcenter_url + "Department/GetList", {
  661. "token": $.cookie("token"),
  662. F_Layer: 2,
  663. F_DeptName:$("#District").find("option:selected").text(),
  664. }, function (data) {
  665. if (data.state.toLowerCase() == "success") {
  666. var content = data.data;
  667. $(content).each(function (i, n) {
  668. $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(obj);
  669. })
  670. }
  671. })
  672. }
  673. $('#District').on('change',function(){
  674. $.getJSON(huayi.config.callcenter_url + "Department/GetList", {
  675. "token": $.cookie("token"),
  676. F_Layer: 2,
  677. F_DeptName:$("#District").find("option:selected").text(),
  678. }, function (data) {
  679. if (data.state.toLowerCase() == "success") {
  680. var content = data.data;
  681. $(content).each(function (i, n) {
  682. $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo("#Branice");
  683. })
  684. FENGONGSI($("#Branice"));
  685. }
  686. })
  687. });
  688. //抽检问题类别
  689. function WTLBCJ(obj) {
  690. obj.empty();
  691. obj.append('<option selected="selected" value="">请选择</option>');
  692. $.getJSON(huayi.config.callcenter_url + "WorkOrder/GetQuestionType", {
  693. "token": $.cookie("token"),
  694. type: 2,
  695. pid:0,
  696. }, function (data) {
  697. if (data.state.toLowerCase() == "success") {
  698. var content = data.data;
  699. $(content).each(function (i, n) {
  700. $("<option value='" + n.id + "'>" + n.text + "</option>").appendTo(obj);
  701. })
  702. }
  703. })
  704. }
  705. //问题类别1
  706. function WTLB1(obj) {
  707. obj.empty();
  708. obj.append('<option selected="selected" value="">请选择</option>');
  709. $.getJSON(huayi.config.callcenter_url + "WorkOrder/GetQuestionType", {
  710. "token": $.cookie("token"),
  711. type: 1,
  712. pid:0,
  713. }, function (data) {
  714. if (data.state.toLowerCase() == "success") {
  715. var content = data.data;
  716. $(content).each(function (i, n) {
  717. $("<option value='" + n.id + "'>" + n.text + "</option>").appendTo(obj);
  718. })
  719. }
  720. })
  721. }
  722. //问题类别2
  723. function WTLB2(obj) {
  724. obj.empty();
  725. obj.append('<option selected="selected" value="">请选择</option>');
  726. $.getJSON(huayi.config.callcenter_url + "WorkOrder/GetQuestionType", {
  727. "token": $.cookie("token"),
  728. type: 1,
  729. pid:$('#cat').val(),
  730. }, function (data) {
  731. if (data.state.toLowerCase() == "success") {
  732. var content = data.data;
  733. $(content).each(function (i, n) {
  734. $("<option value='" + n.id + "'>" + n.text + "</option>").appendTo(obj);
  735. })
  736. }
  737. })
  738. }
  739. // 问题类别3
  740. function WTLB3(obj) {
  741. obj.empty();
  742. obj.append('<option selected="selected" value="">请选择</option>');
  743. $.getJSON(huayi.config.callcenter_url + "WorkOrder/GetQuestionType", {
  744. "token": $.cookie("token"),
  745. type: 1,
  746. pid:$('#catego').val(),
  747. }, function (data) {
  748. if (data.state.toLowerCase() == "success") {
  749. var content = data.data;
  750. $(content).each(function (i, n) {
  751. $("<option value='" + n.id + "'>" + n.text + "</option>").appendTo(obj);
  752. })
  753. }
  754. })
  755. }
  756. $('#cat').on('change',function(){
  757. // alert($('#cat').val())
  758. WTLB2($("#catego"));//问题类型2
  759. // $.getJSON(huayi.config.callcenter_url + "WorkOrder/GetQuestionType", {
  760. // "token": $.cookie("token"),
  761. // type: 1,
  762. //
  763. // pid:$('#cat').val(),
  764. // }, function (data) {
  765. // if (data.state.toLowerCase() == "success") {
  766. // var content = data.data;
  767. // $(content).each(function (i, n) {
  768. // $("<option value='" + n.id + "'>" + n.text + "</option>").appendTo("#catego");
  769. // })
  770. //
  771. // }
  772. // })
  773. });
  774. $('#catego').on('change',function(){
  775. // alert($("#catego").val())
  776. WTLB3($("#cate"));//问题类型3
  777. // $.getJSON(huayi.config.callcenter_url + "WorkOrder/GetQuestionType", {
  778. // "token": $.cookie("token"),
  779. // type: 1,
  780. //
  781. // pid:$('#catego').val()
  782. // }, function (data) {
  783. // if (data.state.toLowerCase() == "success") {
  784. // var content = data.data;
  785. // $(content).each(function (i, n) {
  786. // $("<option value='" + n.id + "'>" + n.text + "</option>").appendTo("#cate");
  787. // })
  788. //
  789. // }
  790. // })
  791. });
  792. //产品种类
  793. function CPZL(obj) {
  794. obj.empty();
  795. obj.append('<option selected="selected" value="">请选择</option>');
  796. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
  797. "token": $.cookie("token"),
  798. flag:"CPZL",
  799. }, function (data) {
  800. if (data.state.toLowerCase() == "success") {
  801. var content = data.data;
  802. $(content).each(function (i, n) {
  803. $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
  804. })
  805. }
  806. })
  807. }
  808. //重要界别
  809. function ZYJB(obj) {
  810. obj.empty();
  811. obj.append('<option selected="selected" value="">请选择</option>');
  812. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
  813. "token": $.cookie("token"),
  814. flag:"ZYJB",
  815. }, function (data) {
  816. if (data.state.toLowerCase() == "success") {
  817. var content = data.data;
  818. $(content).each(function (i, n) {
  819. $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
  820. })
  821. }
  822. })
  823. }
  824. //抽检模块
  825. function CJJP(obj) {
  826. obj.empty();
  827. obj.append('<option selected="selected" value="">请选择</option>');
  828. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
  829. "token": $.cookie("token"),
  830. flag:"CJJP",
  831. }, function (data) {
  832. if (data.state.toLowerCase() == "success") {
  833. var content = data.data;
  834. $(content).each(function (i, n) {
  835. $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
  836. })
  837. }
  838. })
  839. }
  840. function CJDW(obj) {
  841. obj.empty();
  842. obj.append('<option selected="selected" value="">请选择</option>');
  843. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
  844. "token": $.cookie("token"),
  845. flag:"CJDW",
  846. }, function (data) {
  847. if (data.state.toLowerCase() == "success") {
  848. var content = data.data;
  849. $(content).each(function (i, n) {
  850. $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
  851. })
  852. }
  853. })
  854. }
  855. //。。。。。。。。。。。。。。。。。。。。。。。
  856. function YFPP(obj) {
  857. obj.empty();
  858. obj.append('<option selected="selected" value="">请选择</option>');
  859. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
  860. "token": $.cookie("token"),
  861. flag:"YFPP",
  862. }, function (data) {
  863. if (data.state.toLowerCase() == "success") {
  864. var content = data.data;
  865. $(content).each(function (i, n) {
  866. $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
  867. })
  868. }
  869. })
  870. }
  871. //渠道类型
  872. function QDLX(obj) {
  873. obj.empty();
  874. obj.append('<option selected="selected" value="">请选择</option>');
  875. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
  876. "token": $.cookie("token"),
  877. flag:"QDLX",
  878. }, function (data) {
  879. if (data.state.toLowerCase() == "success") {
  880. var content = data.data;
  881. $(content).each(function (i, n) {
  882. $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
  883. })
  884. }
  885. })
  886. }
  887. //信用等级
  888. function XYDJ(obj) {
  889. obj.empty();
  890. obj.append('<option selected="selected" value="">请选择</option>');
  891. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
  892. "token": $.cookie("token"),
  893. flag:"XYDJ",
  894. }, function (data) {
  895. if (data.state.toLowerCase() == "success") {
  896. var content = data.data;
  897. $(content).each(function (i, n) {
  898. $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
  899. })
  900. }
  901. })
  902. }
  903. //经营品牌
  904. function JYPP(obj) {
  905. obj.empty();
  906. obj.append('<option selected="selected" value="">请选择</option>');
  907. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
  908. "token": $.cookie("token"),
  909. flag:"JYPP",
  910. }, function (data) {
  911. if (data.state.toLowerCase() == "success") {
  912. var content = data.data;
  913. $(content).each(function (i, n) {
  914. $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
  915. })
  916. }
  917. })
  918. }
  919. //产品
  920. function CAPI(obj) {
  921. obj.empty();
  922. obj.append('<option selected="selected" value="">请选择</option>');
  923. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
  924. "token": $.cookie("token"),
  925. flag:"CAPI",
  926. }, function (data) {
  927. if (data.state.toLowerCase() == "success") {
  928. var content = data.data;
  929. $(content).each(function (i, n) {
  930. $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
  931. })
  932. }
  933. })
  934. }
  935. function DQQ(obj) {
  936. obj.empty();
  937. obj.append('<option selected="selected" value="">请选择</option>');
  938. $.getJSON(huayi.config.callcenter_url + "Department/GetList", {
  939. "token": $.cookie("token"),
  940. F_Layer: 1,
  941. }, function (data) {
  942. if (data.state.toLowerCase() == "success") {
  943. var content = data.data;
  944. $(content).each(function (i, n) {
  945. $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(obj);
  946. })
  947. }
  948. })
  949. }
  950. function KEFENGONG(obj) {
  951. obj.empty();
  952. obj.append('<option selected="selected" value="">请选择</option>');
  953. $.getJSON(huayi.config.callcenter_url + "Department/GetList", {
  954. "token": $.cookie("token"),
  955. F_Layer: 2,
  956. F_DeptName:$("#customer_comaddress").find("option:selected").text(),
  957. }, function (data) {
  958. if (data.state.toLowerCase() == "success") {
  959. var content = data.data;
  960. $(content).each(function (i, n) {
  961. $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(obj);
  962. })
  963. }
  964. })
  965. }
  966. $('#customer_comaddress').on('change',function(){
  967. $.getJSON(huayi.config.callcenter_url + "Department/GetList", {
  968. "token": $.cookie("token"),
  969. F_Layer: 2,
  970. F_DeptName:$("#customer_comaddress").find("option:selected").text(),
  971. }, function (data) {
  972. if (data.state.toLowerCase() == "success") {
  973. var content = data.data;
  974. $(content).each(function (i, n) {
  975. $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo("#customer_legalName");
  976. })
  977. KEFENGONG($("#customer_legalName"));
  978. }
  979. })
  980. });
  981. //工单类型点选
  982. $('.r_order_type').find('input[type="radio"]').on('change', function() {
  983. if($(this).val() === "1") { //咨询
  984. $('#PageArrival').show(); //receive
  985. $('#Duration').hide();
  986. $('#Depth').hide();
  987. $('#Page').hide();
  988. $('#wlbm').hide();
  989. $('#wlmcc').hide();
  990. } else if($(this).val() === "2"){ //投诉
  991. $('#PageArrival').hide(); //receive
  992. $('#Duration').show();
  993. $('#Depth').hide();
  994. $('#Page').hide();
  995. $('#wlbm').show();
  996. $('#wlmcc').show();
  997. }else if($(this).val() === "3"){ //抽检
  998. $('#PageArrival').hide(); //receive
  999. $('#Duration').hide();
  1000. $('#Depth').show();
  1001. $('#Page').hide();
  1002. $('#wlbm').show();
  1003. $('#wlmcc').show();
  1004. }else if($(this).val() === "4"){ //建议其他
  1005. $('#PageArrival').hide(); //receive
  1006. $('#Duration').hide();
  1007. $('#Depth').hide();
  1008. $('#Page').show();
  1009. $('#wlbm').hide();
  1010. $('#wlmcc').hide();
  1011. }
  1012. });
  1013. $("#customer_code").blur(function(){
  1014. ischeckNum();
  1015. })