暂无描述

addOrEditWorkOrder.js 30KB

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