| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184 |
- /**
- * 手工制单
- * */
- var CallID = helper.request.queryString("CallID");
- var KHid;
- var UserCode;
- var timestamp = Date.parse(new Date());
- //通话中执行变化
- var timer, n = 0;
- //初始化时间
- laydate.render({
- elem: '#der_time',
- theme: '#1ab394',
- calendar: true
- });
- //**所有input去掉自动填充
- $(function() {
- if($.cookie("userRoleCode") == "DQJL" || $.cookie("userRoleCode") == "FGSJL" || $.cookie("userRoleCode") == "YWY") {
- $(".codeDiv").remove();
- $("#save_vsv").hide();
- $("#save_order").show();
- }
- $('input:not([autocomplete]),textarea:not([autocomplete]),select:not([autocomplete])').attr('autocomplete', 'off');
- });
- // 立即处理
- $('#order_isover').find('input[type="radio"]').on('change', function() {
- if($(this).val() === '1') {
- $('#order_transfer_depts').hide();
- } else {
- $('#order_transfer_depts').show();
- }
- });
- function clearInter() {
- clearInterval(timer);
- }
- //获取接收人员
- function getReceiveUser(obj, deptid) {
- $.ajax({
- url: huayi.config.callcenter_url + 'UserAccount/GetDeptUserList',
- type: 'get',
- data: {
- deptid: deptid,
- token: $.cookie("token")
- },
- dataType: "json",
- async: true,
- success: function(res) {
- obj.empty();
- if(res.state.toLowerCase() === "success") {
- res = res.data;
- if(res && res.length > 0) {
- obj.append('<option value="0">请选择接收人</option>');
- res.forEach(function(v, i) {
- obj.append('<option value="' + v.F_UserId + '" data-code="' + v.F_UserCode + '">' + v.F_UserName + '(' + v.F_UserCode + ')</option>');
- });
- obj.selectpicker('refresh');
- }
- }
- },
- });
- }
- var callId = helper.request.queryString("cid");
- $(function() {
- var cphone = helper.request.queryString("cphone");
- var cCustomerName = decodeURIComponent(helper.request.queryString("cCustomerName"));
- if(cphone){
- $('#kehudian').val(cphone)
- }
- if(cCustomerName){
- $('#kehuxing').val(cCustomerName);
- }
- helper.getDropList.getlistDropByDic($('#order_handle'), 'YWLX');
- $('#save_order').click(function() { //ID为test的元素点击时
- orderSave();
- });
- // 指派按钮
- $('#save_vsv').click(function() { //ID为test的元素点击时
- dealWorkOrder();
- });
- // 完结按钮
- $('#save_ssss').click(function() { //ID为test的元素点击时
- buttonend();
- });
- // 来电保存客户
- $('#save').click(function() { //ID为test的元素点击时
- if(!regexs.userNameReg.test($.trim($('#head_form_custom').val()))) {
- layer.confirm('请输入有效的客户姓名!', {
- icon: 2,
- btn: ['确定']
- });
- return;
- }
- screen();
- });
- $('#empty').click(function() { //ID为test的元素点击时
- cleanOrde();
- });
- });
- //新建工单 保存
- function orderSave() {
- typePro();
- $.ajax({
- type:"post",
- url:huayi.config.callcenter_url + 'WorkOrderNew/Add',
- async:true,
- beforeSend: function() { //触发ajax请求开始时执行
- $('#save_order').attr("disabled", true);
- $('#save_order').text('创建中...');
- },
- data:{
- // orderid: oid, //否 strubg 工单ID
- F_Source: $('#godanlx').val(), //
- // F_CompanyName: $('#order_company').val(),// 公司名称
- F_Type: $('#order_isover').find('input[type="radio"]:checked').val(), //工单类型
- //公共字段
- F_CusName: $('#kehuxing').val(), //客户姓名
- F_CusPhone: $('#kehudian').val(), //客户电话
- F_CompanyName: $('#gonsi').val(), //公司名称
- F_IncidentProvince: $('#sheng').val(), //string 省
- F_IncidentCity: $('#shi').val(), // 市
- F_IncidentCountry: $('#quxian').val(), //区/县
- F_IncidentTownship: $('#xiang').val(), //乡
- F_IncidentDetailed: $('#xiangxi').val(), //详细地址
- F_Description: $('#reception').val(), //问题描述
- //咨询模块
- F_QuestionType: catt, //问题类别
- F_TS_Category: comdi, //产品名称
- F_ZX_Quantity: stion, //问题数量
- F_SalesBase: coint, //销售基地
- //投诉模块
- F_BatchNumber: shengch, //生产批号
- F_TS_Formula: $('#formula').val(), //配方
- F_TS_Quantity: $('#quantity').val(), //问题数量(吨)
- F_TS_Level: $('#level').val(), //重要界别
- F_CustomerID: $('#number').val(), //客户编号
- F_Salesman: $('#salesman').val(), //业务员
- F_SalesPhone: $('#telephone').val(), //电话
- F_AreaName: $('#chdaqu').val(), //大区
- F_BranchName: $('#chfen').val(), //分公司
- F_Brands: $('#manage').val(), //经营品牌
- F_WorkerBrand: $('#about_brand').val(), //品牌
- F_CompanyName: $('#F_CompanyName').val(), //公司名称
- F_MaterialID: $('#Code').val(), //客户编号
- F_CustomerID: $('#number').val(), //客户编号
- F_Model: $('#model_number').val(), //型号
- F_Specs: $('#specifications').val(), //规格
- F_Level1: $('#category1').val(), //一级分类
- F_Level2: $('#category2').val(), //二级分类
- F_Level3: $('#category3').val(), //三级分类
- F_Brand: $('#brand_name').val(), //品牌
- F_MaterialEffect: $('#efficiency').val(), //复合肥肥效
- F_Pipeline: $('#product_line').val(), //产品线
- F_Craft: $('#process').val(), //工艺
- F_Formula: $('#enter_formula').val(), //配方
- //抽检模块
- // F_CusName: $('#kxing').val(),//客户姓名
- // F_CusPhone: $('#kdian').val(),//客户电话
- // F_QuestionType:catt, //问题类别
- F_CJ_Time: $('#der_time').val(), //抽检时间
- F_CJ_Level: $('#der_level').val(), //抽检级别
- F_CJ_Unit: $('#der_Company').val(), //抽检单位
- F_CJ_TestUnit: $('#der_Test').val(), //化验单位
- F_CJ_Tonnage: $('#der_Tonnage').val(), //抽检吨数
- F_CJ_BagNo: $('#der_Ton').val(), //抽检袋数
- F_CJ_Outlay: $('#der_Amount').val(), //公关费用金额
- overtime: $("#dddd").find('input[type="radio"]:checked').val(), //超时时限
- clbm: $("#clbm").val(), //否 指派部门
- clid: $("#clid").val(), //否 接受人
- F_Files: proimglist && proimglist.join(','), //附件
- sms: $("#overtime").find('input[type="radio"]:checked').val(), //是否发送短信
- token: $.cookie("token")
- },
- success:function(result){
- result = $.parseJSON(result);
- if(result.state.toLowerCase() == "success") {
- cleanOrderForm();
- // top.workcount();
- layer.msg("保存成功");
- window.location.reload();
- $('#save_order').attr("disabled", false);
- $('#save_order').text('创建');
- }else{
- $('#save_order').attr("disabled", false);
- $('#save_order').text('创建');
- }
- }
- });
- }
- //完结按钮
- function buttonend(oid) {
- typePro();
- // var ltype = $("input[name='ltype']:checked").val();
- var isDetail = helper.request.queryString("isDetail"); //是否是详情页面的处理
- $.ajax({
- type:"post",
- url:huayi.config.callcenter_url + 'WorkOrderNew/CreatOver',
- async:true,
- beforeSend: function() { //触发ajax请求开始时执行
- $('#save_ssss').attr("disabled", true);
- $('#save_ssss').text('完结中...');
- },
- data:{
- orderid: oid, //否 strubg 工单ID
- F_Source: $('#godanlx').val(), //
- // F_CompanyName: $('#order_company').val(),// 公司名称
- F_Type: $('#order_isover').find('input[type="radio"]:checked').val(), //工单类型
- //公共字段
- F_CusName: $('#kehuxing').val(), //客户姓名
- F_CusPhone: $('#kehudian').val(), //客户电话
- F_CompanyName: $('#gonsi').val(), //公司名称
- F_IncidentProvince: $('#sheng').val(), //string 省
- F_IncidentCity: $('#shi').val(), // 市
- F_IncidentCountry: $('#quxian').val(), //区/县
- F_IncidentTownship: $('#xiang').val(), //乡
- F_IncidentDetailed: $('#xiangxi').val(), //详细地址
- F_Description: $('#reception').val(), //问题描述
- //咨询模块
- F_QuestionType: catt, //问题类别
- F_TS_Category: comdi, //产品名称
- F_ZX_Quantity: $('#Product_Quantity').val(), //问题数量
- F_SalesBase: coint, //销售基地
- //投诉模块
- F_BatchNumber: shengch, //生产批号
- F_TS_Formula: $('#formula').val(), //配方
- F_TS_Quantity: $('#quantity').val(), //问题数量(吨)
- F_TS_Level: $('#level').val(), //重要界别
- F_CustomerID: $('#number').val(), //客户编号
- F_Salesman: $('#salesman').val(), //业务员
- F_SalesPhone: $('#telephone').val(), //电话
- F_AreaName: $('#chdaqu').val(), //大区
- F_BranchName: $('#chfen').val(), //分公司
- F_Brands: $('#manage').val(), //经营品牌
- F_MaterialID: $('#Code').val(), //客户编号
- F_CustomerID: $('#number').val(), //客户编号
- F_Model: $('#model_number').val(), //型号
- F_Specs: $('#specifications').val(), //规格
- F_Level1: $('#category1').val(), //一级分类
- F_Level2: $('#category2').val(), //二级分类
- F_Level3: $('#category3').val(), //三级分类
- F_Brand: $('#brand_name').val(), //品牌
- F_MaterialEffect: $('#efficiency').val(), //复合肥肥效
- F_Pipeline: $('#product_line').val(), //产品线
- F_Craft: $('#process').val(), //工艺
- F_Formula: $('#enter_formula').val(), //配方
- F_WorkerBrand: $('#about_brand').val(), //品牌
- //抽检模块
- // F_CusName: $('#kxing').val(),//客户姓名
- // F_CusPhone: $('#kdian').val(),//客户电话
- // F_QuestionType:catt, //问题类别
- F_CJ_Time: $('#der_time').val(), //抽检时间
- F_CJ_Level: $('#der_level').val(), //抽检级别
- F_CJ_Unit: $('#der_Company').val(), //抽检单位
- F_CJ_TestUnit: $('#der_Test').val(), //化验单位
- F_CJ_Tonnage: $('#der_Tonnage').val(), //抽检吨数
- F_CJ_BagNo: $('#der_Ton').val(), //抽检袋数
- F_CJ_Outlay: $('#der_Amount').val(), //公关费用金额
- overtime: $("#dddd").find('input[type="radio"]:checked').val(), //超时时限
- clbm: $("#clbm").val(), //否 指派部门
- clid: $("#clid").val(), //否 接受人
- sms: $("#overtime").find('input[type="radio"]:checked').val(), //是否发送短信
- token: $.cookie("token")
- },
- success:function(result){
- result = $.parseJSON(result);
- if(result.state.toLowerCase() == "success") {
- $('#save_ssss').attr("disabled", false);
- $('#save_ssss').text('完结');
- // parent.parent.layer.msg("工单完结成功!");
- cleanOrderForm();
- layer.msg("完结成功");
- // top.workcount();
- }else{
- $('#save_ssss').attr("disabled", false);
- $('#save_ssss').text('完结');
- }
- }
- });
- }
- //投诉和抽检客户 物料编号清空
- function emptyct() {
- $('#number').val('');
- $('#salesman').val('');
- $('#telephone').val('');
- $('#District').val('');
- $('#Branice').val('');
- $('#manage').val('');
- $('#Code').val('');
- $('#material_name').val('');
- $('#model_number').val('');
- $('#specifications').val('');
- $('#category1').val('');
- $('#category2').val('');
- $('#category3').val('');
- $('#brand_name').val('');
- $('#efficiency').val('');
- $('#product_line').val('');
- $('#process').val('');
- $('#enter_formula').val('');
- }
- var catt; //问题类别
- var cttt; //投诉问题类别
- var comdi; //产品名称
- var coint; //销售基地
- var stion; //问题数量
- var shengch; //生产批次号
- var jyppai;
- var daqu;
- var fengo;
- var orderIsover;
- function typePro() {
- orderIsover = $('input:radio[name="type"]:checked').val();
- if(orderIsover === '1') {
- debugger
- catt = $('#category').val(); //问题类别
- comdi = $('#ProductName').val(); //产品名称
- stion = $('#Product_Quantity').val(); //问题数量
- coint = $('#xiaoshou').val(); //销售基地
- daqu = '';
- fengo = '';
- jyppai = '';
- cttt = '';
- shengch = '';
- emptyct()
- $('#wlbm').hide();
- $('#wlmcc').hide();
- $('#clie').hide();
- $('#mate').hide();
- } else if(orderIsover === '2') {
- // daqu=$('#chdaqu').val();
- // fengo=$('#chfen').val();
- jyppai = $('#brand_name').val();
- comdi = $('#product_name').val(); //产品名称
- cttt = $("#cate").val();
- // if($("#catego").val()){
- // cttt = $("#cat").val()+"|"+$("#catego").val();
- // if($("#cate").val()){
- // cttt = $("#cat").val()+"|"+$("#catego").val()+"|"+$("#cate").val();
- // }
- // }
- catt = $("#cate").val();
- shengch = $('#Batch_number').val(); //生产批次号
- stion = $('#quantity').val(); //问题数量
- coint = $('#Sales_base').val(); //销售基地
- } else if(orderIsover === '3') {
- // daqu=$('#District').val();
- // fengo=$('#Branice').val();
- jyppai = $('#brand_name').val();
- shengch = $('#batch_num').val(); //生产批次号
- catt = $('#chou_wtlb').val();
- // cttt=$('#chou_wtlb').val();
- comdi = '';
- coint = '';
- stion = '';
- } else if(orderIsover === '4') {
- catt = $('#cateq').val(); //问题类别
- comdi = $('#Produ_ctName').val(); //产品名称
- stion = $('#Product_Quan').val(); //问题数量
- coint = $('#xiaosh').val(); //销售基地
- daqu = '';
- fengo = '';
- jyppai = '';
- cttt = '';
- shengch = '';
- emptyct()
- $('#wlbm').hide();
- $('#wlmcc').hide();
- $('#clie').hide();
- $('#mate').hide();
- // alert(catt)
- }
- }
- // 指派按钮
- function dealWorkOrder(oid) {
- typePro();
- $.ajax({
- type:"post",
- url:huayi.config.callcenter_url + 'WorkOrderNew/Createass',
- async:true,
- beforeSend: function() { //触发ajax请求开始时执行
- $('#save_vsv').attr("disabled", true);
- $('#save_vsv').text('指派中...');
- },
- data:{
- orderid: oid, //否 strubg 工单ID
- F_Source: $('#godanlx').val(), //
- // F_CompanyName: $('#order_company').val(),// 公司名称
- F_Type: $('#order_isover').find('input[type="radio"]:checked').val(), //工单类型
- //公共字段
- F_CusName: $('#kehuxing').val(), //客户姓名
- F_CusPhone: $('#kehudian').val(), //客户电话
- F_CompanyName: $('#gonsi').val(), //公司名称
- F_IncidentProvince: $('#sheng').val(), //string 省
- F_IncidentCity: $('#shi').val(), // 市
- F_IncidentCountry: $('#quxian').val(), //区/县
- F_IncidentTownship: $('#xiang').val(), //乡
- F_IncidentDetailed: $('#xiangxi').val(), //详细地址
- F_Description: $('#reception').val(), //问题描述
- //咨询模块
- F_QuestionType: catt, //问题类别
- F_TS_Category: comdi, //产品名称
- F_ZX_Quantity: stion, //问题数量
- F_SalesBase: coint, //销售基地
- //投诉模块
- F_BatchNumber: shengch, //生产批号
- F_TS_Formula: $('#formula').val(), //配方
- F_TS_Quantity: $('#quantity').val(), //问题数量(吨)
- F_TS_Level: $('#level').val(), //重要界别
- // F_SalesPhone: $('#telephone').val(),//电话
- F_ZX_Area: daqu, //大区
- F_ZX_Branch: fengo, //分公司
- F_Brand: jyppai, //经营品牌
- F_Salesman: $('#salesman').val(), //业务员
- F_SalesPhone: $('#telephone').val(), //电话
- F_AreaName: $('#chdaqu').val(), //大区
- F_BranchName: $('#chfen').val(), //分公司
- F_Brands: $('#manage').val(), //经营品牌
- // F_Salesman: $('#salesman').val(),//业务员
- F_MaterialID: $('#Code').val(), //客户编号
- F_CustomerID: $('#number').val(), //客户编号
- F_Model: $('#model_number').val(), //型号
- F_Specs: $('#specifications').val(), //规格
- F_Level1: $('#category1').val(), //一级分类
- F_Level2: $('#category2').val(), //二级分类
- F_Level3: $('#category3').val(), //三级分类
- // F_Brand: $('#brand_name').val(),//品牌
- F_MaterialEffect: $('#efficiency').val(), //复合肥肥效
- F_Pipeline: $('#product_line').val(), //产品线
- F_Craft: $('#process').val(), //工艺
- F_Formula: $('#enter_formula').val(), //配方
- F_WorkerBrand: $('#about_brand').val(), //品牌
- //抽检模块
- // F_CusName: $('#kxing').val(),//客户姓名
- // F_CusPhone: $('#kdian').val(),//客户电话
- // F_QuestionType:cttt, //问题类别
- F_CJ_Time: $('#der_time').val(), //抽检时间
- F_CJ_Level: $('#der_level').val(), //抽检级别
- F_CJ_Unit: $('#der_Company').val(), //抽检单位
- F_CJ_TestUnit: $('#der_Test').val(), //化验单位
- F_CJ_Tonnage: $('#der_Tonnage').val(), //抽检吨数
- F_CJ_BagNo: $('#der_Ton').val(), //抽检袋数
- F_CJ_Outlay: $('#der_Amount').val(), //公关费用金额
- overtime: $("#dddd").find('input[type="radio"]:checked').val(), //超时时限
- clbm: $("#clbm").val(), //否 指派部门
- clid: $("#clid").val(), //否 接受人
- F_Files: proimglist && proimglist.join(','), //附件
- sms: $("#overtime").find('input[type="radio"]:checked').val(), //是否发送短信
- token: $.cookie("token")
- },
- success:function(result){
- result = $.parseJSON(result);
- if(result.state.toLowerCase() == "success") {
- // top.workcount();
- $('#save_vsv').attr("disabled", false);
- $('#save_vsv').text('指派');
- cleanOrderForm();
- layer.msg("指派成功");
- setTimeout(function(){
- window.location.reload();
- },700)
- }else{
- $('#save_vsv').attr("disabled", false);
- $('#save_vsv').text('指派');
- }
- }
- });
-
- }
- //三级联动下拉
- $(document).ready(function() {
- var wid = helper.request.queryString("wid");
- LY($("#sheng")); //省
- XSJD($("#xiaoshou")); //销售基地
- XSJD($("#xiaosh")); //建议及其他销售基地
- XSJD($("#Sales_base")); //建议及其他销售基地
- ZXWTLB($("#category")); //咨询问题类别
- // ZXWTLB($("#categg")); //问题类别
- ZXCPMC($("#ProductName"));
- // ZXCPMC($("#ProductName"));
- ZXCPMC($("#product_name"));
- ZXCPMC($("#Produ_ctName")); //建议及其他产品名称
- DQ($("#District"));
- //投诉模块
- WTLB1($("#cat")); //问题类型1
- CPZL($("#Product_Category")); //产品名称
- WTLBCJ($("#chou_wtlb")); //抽检问题类型
- ZYJB($("#level")); //重要级别
- CJJP($("#der_level")); //抽检级别
- CJDW($("#der_Company")); //抽检单位
- DQQ($("#customer_comaddress")); //大区
- QDLX($("#customer_taxPointDes")); //添加客户渠道类型
- QDLX($("#channel")); //来电弹屏渠道类型
- XYDJ($("#customer_invoiceRange"));
- JYPP($("#customer_Qualification"));
- JYPP($("#management"));
- CAPI($("#customer_FinancialManager"));
- YFPP($("#customer_feeEx"));
- YFPP($("#fertilizer"));
- });
- // 客户信息里的 省/市/区/县
- // 咨询模块 省
- function LY(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
- "token": $.cookie("token"),
- F_Layer: 1,
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_RegionName + "'>" + n.F_RegionName + "</option>").appendTo(obj);
- })
- }
- })
- }
- //市
- function LB(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
- "token": $.cookie("token"),
- F_Layer: 2,
- F_RegionName: $('#sheng').val()
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_RegionName + "'>" + n.F_RegionName + "</option>").appendTo(obj);
- })
- }
- })
- }
- // 区/县
- function ZT(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
- "token": $.cookie("token"),
- F_Layer: 3,
- F_RegionName: $('#shi').val()
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_RegionName + "'>" + n.F_RegionName + "</option>").appendTo(obj);
- })
- }
- })
- }
- // 乡
- function XX(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
- "token": $.cookie("token"),
- F_Layer: 4,
- F_RegionName: $('#quxian').val()
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_RegionName + "'>" + n.F_RegionName + "</option>").appendTo(obj);
- })
- }
- })
- }
- $('#sheng').on('change', function() {
- $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
- "token": $.cookie("token"),
- F_Layer: 2,
- F_RegionName: $('#sheng').val(),
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_RegionName + "'>" + n.F_RegionName + "</option>").appendTo("#shi");
- })
- LB($("#shi"));
- }
- })
- });
- $('#shi').on('change', function() {
- $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
- "token": $.cookie("token"),
- F_Layer: 3,
- F_RegionName: $('#shi').val()
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_RegionName + "'>" + n.F_RegionName + "</option>").appendTo("#quxian");
- })
- ZT($("#quxian"));
- }
- })
- });
- $('#quxian').on('change', function() {
- $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
- "token": $.cookie("token"),
- F_Layer: 4,
- F_RegionName: $('#quxian').val()
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_RegionName + "'>" + n.F_RegionName + "</option>").appendTo("#xiang");
- })
- XX($('#xiang'));
- }
- })
- });
- //销售基地
- function XSJD(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
- "token": $.cookie("token"),
- flag: "XSJD",
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
- })
- }
- })
- }
- //问题类别
- function ZXWTLB(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "WorkOrder/GetQuestionNameType", {
- "token": $.cookie("token"),
- type: 3,
- // pid:0,
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.id + "'>" + n.text + "</option>").appendTo(obj);
- })
- }
- })
- }
- function ZXCPMC(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
- "token": $.cookie("token"),
- flag: "CPZL",
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
- })
- }
- })
- }
- function DQ(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Department/GetList", {
- "token": $.cookie("token"),
- F_Layer: 1,
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(obj);
- })
- }
- })
- }
- function FENGONGSI(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Department/GetList", {
- "token": $.cookie("token"),
- F_Layer: 2,
- F_DeptName: $("#District").find("option:selected").text(),
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(obj);
- })
- }
- })
- }
- $('#District').on('change', function() {
- $.getJSON(huayi.config.callcenter_url + "Department/GetList", {
- "token": $.cookie("token"),
- F_Layer: 2,
- F_DeptName: $("#District").find("option:selected").text(),
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo("#Branice");
- })
- FENGONGSI($("#Branice"));
- }
- })
- });
- //清空表单
- function cleanOrderForm() {
- // $("#lygon").val(data.F_SourceName);//工单来源
- // $('#gdbian').val(data.F_WorkOrderCode);// 工单编号
- // 咨询模块
- $("#category").val(''); //问题类别
- $("#ProductName").val(''); //产品名称
- $('#Product_Quantity').val(''); //问题数量
- $("#xiaoshou").val(''); //销售基地
- // 投诉模块
- $("#product_name").val(''); //产品名称
- $('#quantity').val(''); //问题数量
- $('#Batch_number').val(''); //生产批次
- $("#Sales_base").val(''); //销售基地
- $("#level").val(''); //重要级别
- $("#cat").val(''); //问题类别1
- $("#catego").val(''); //问题类别2
- $("#cate").val(''); //问题类别3
- $('#about_brand').val(''); //品牌
- // 抽检模块
- $("#chou_wtlb").val(''); //问题类别
- $("#der_level").val(''); //抽检级别
- $('#batch_num').val(''); //生产批次号
- $("#der_Company").val(''); //抽检单位
- $('#der_Test').val(''); //化验单位
- $('#der_Tonnage').val(''); //抽检吨数
- $('#der_Ton').val(''); //抽检袋数
- $('#der_Amount').val(''); //公关费用金额
- $('#der_time').val(''); //抽检时间
- // 建议及其他
- $("#cateq").val(''); //问题类别
- $("#Produ_ctName").val(''); //产品名称
- $('#Product_Quan').val(''); //问题数量
- $("#xiaosh").val(''); //销售基地
- // 公共模块
- $('#number').val(''); //客户编码
- $('#salesman').val(''); //业务员
- $('#telephone').val(''); //电话
- $("#chdaqu").val(''); //大区
- $("#chfen").val(''); //分公司
- $('#manage').val(''); //经营品牌
- //物料
- $('#Code').val(''); //物料编码
- $('#material_name').val(''); //物料名称
- $('#model_number').val(''); //型号
- $('#specifications').val(''); //规格
- $('#category1').val(''); //一级分类
- $('#category2').val(''); //二级分类
- $('#category3').val(''); //三级分类
- $('#brand_name').val(''); //品牌
- $('#efficiency').val(''); //复合肥肥效
- $('#product_line').val(''); //产品线
- $('#process').val(''); //工艺
- $('#enter_formula').val(''); //配方
- $('#kehuxing').val(''); //客户姓名
- $('#kehudian').val(''); //客户电话
- $('#gonsi').val(''), //公司名称
- $("#sheng").val(''); // 省
- $("#shi").val(''); //市
- $("#quxian").val(''); //区县
- $("#xiang").val(''); //乡
- $("#xiangxi").val(''); //详细
- $('#reception').val(''); //问题描述
- overtime: $("#dddd").find('input[type="radio"]:checked').val(''); //超时时限
- clbm: $("#clbmname").val(''); //否 指派部门
- clid: $(".select").val(''); //否 接受人
- sms: $("#overtime").find('input[type="radio"]:checked').val(''); //是否发送短信
- $("#fileList>li").remove();
- }
- //抽检问题类别
- function WTLBCJ(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "WorkOrder/GetQuestionType", {
- "token": $.cookie("token"),
- type: 2,
- pid: 0,
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.id + "'>" + n.text + "</option>").appendTo(obj);
- })
- }
- })
- }
- //问题类别1
- function WTLB1(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "WorkOrder/GetQuestionType", {
- "token": $.cookie("token"),
- type: 1,
- pid: 0,
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.id + "'>" + n.text + "</option>").appendTo(obj);
- })
- }
- })
- }
- //问题类别2
- function WTLB2(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "WorkOrder/GetQuestionType", {
- "token": $.cookie("token"),
- type: 1,
- pid: $('#cat').val(),
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.id + "'>" + n.text + "</option>").appendTo(obj);
- })
- }
- })
- }
- // 问题类别3
- function WTLB3(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "WorkOrder/GetQuestionType", {
- "token": $.cookie("token"),
- type: 1,
- pid: $('#catego').val(),
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.id + "'>" + n.text + "</option>").appendTo(obj);
- })
- }
- })
- }
- $('#cat').on('change', function() {
- // alert($('#cat').val())
- WTLB2($("#catego")); //问题类型2
- // $.getJSON(huayi.config.callcenter_url + "WorkOrder/GetQuestionType", {
- // "token": $.cookie("token"),
- // type: 1,
- //
- // pid:$('#cat').val(),
- // }, function (data) {
- // if (data.state.toLowerCase() == "success") {
- // var content = data.data;
- // $(content).each(function (i, n) {
- // $("<option value='" + n.id + "'>" + n.text + "</option>").appendTo("#catego");
- // })
- //
- // }
- // })
- });
- $('#catego').on('change', function() {
- // alert($("#catego").val())
- WTLB3($("#cate")); //问题类型3
- // $.getJSON(huayi.config.callcenter_url + "WorkOrder/GetQuestionType", {
- // "token": $.cookie("token"),
- // type: 1,
- //
- // pid:$('#catego').val()
- // }, function (data) {
- // if (data.state.toLowerCase() == "success") {
- // var content = data.data;
- // $(content).each(function (i, n) {
- // $("<option value='" + n.id + "'>" + n.text + "</option>").appendTo("#cate");
- // })
- //
- // }
- // })
- });
- //产品种类
- function CPZL(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
- "token": $.cookie("token"),
- flag: "CPZL",
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
- })
- }
- })
- }
- //重要界别
- function ZYJB(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
- "token": $.cookie("token"),
- flag: "ZYJB",
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
- })
- }
- })
- }
- //抽检模块
- function CJJP(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
- "token": $.cookie("token"),
- flag: "CJJP",
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
- })
- }
- })
- }
- function CJDW(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
- "token": $.cookie("token"),
- flag: "CJDW",
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
- })
- }
- })
- }
- //。。。。。。。。。。。。。。。。。。。。。。。
- function YFPP(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
- "token": $.cookie("token"),
- flag: "YFPP",
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
- })
- }
- })
- }
- //渠道类型
- function QDLX(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
- "token": $.cookie("token"),
- flag: "QDLX",
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
- })
- }
- })
- }
- //信用等级
- function XYDJ(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
- "token": $.cookie("token"),
- flag: "XYDJ",
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
- })
- }
- })
- }
- //经营品牌
- function JYPP(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
- "token": $.cookie("token"),
- flag: "JYPP",
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
- })
- }
- })
- }
- //产品
- function CAPI(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
- "token": $.cookie("token"),
- flag: "CAPI",
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
- })
- }
- })
- }
- function DQQ(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Department/GetList", {
- "token": $.cookie("token"),
- F_Layer: 1,
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(obj);
- })
- }
- })
- }
- function KEFENGONG(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Department/GetList", {
- "token": $.cookie("token"),
- F_Layer: 2,
- F_DeptName: $("#customer_comaddress").find("option:selected").text(),
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(obj);
- })
- }
- })
- }
- $('#customer_comaddress').on('change', function() {
- $.getJSON(huayi.config.callcenter_url + "Department/GetList", {
- "token": $.cookie("token"),
- F_Layer: 2,
- F_DeptName: $("#customer_comaddress").find("option:selected").text(),
- }, function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo("#customer_legalName");
- })
- KEFENGONG($("#customer_legalName"));
- }
- })
- });
- //工单类型点选
- $('.r_order_type').find('input[type="radio"]').on('change', function() {
- if($(this).val() === "1") { //咨询
- $('#PageArrival').show(); //receive
- $('#Duration').hide();
- $('#Depth').hide();
- $('#Page').hide();
- $('#wlbm').hide();
- $('#wlmcc').hide();
- $('.noSampling').show();
- $('.Sampling').hide();
- $("#dddd input[type=radio][value='12']").prop("checked", true);
- } else if($(this).val() === "2") { //投诉
- $('#PageArrival').hide(); //receive
- $('#Duration').show();
- $('#Depth').hide();
- $('#Page').hide();
- $('#wlbm').show();
- $('#wlmcc').show();
- $('.Sampling').hide();
- $('.noSampling').show();
- $("#dddd input[type=radio][value='12']").prop("checked", true);
- } else if($(this).val() === "3") { //抽检
- $('#PageArrival').hide(); //receive
- $('#Duration').hide();
- $('#Depth').show();
- $('#Page').hide();
- $('#wlbm').show();
- $('#wlmcc').show();
- $('.Sampling').show();
- $('.noSampling').hide();
- $("#dddd input[type=radio][value='720']").prop("checked", true);
- } else if($(this).val() === "4") { //建议其他
- $('#PageArrival').hide(); //receive
- $('#Duration').hide();
- $('#Depth').hide();
- $('#Page').show();
- $('#wlbm').hide();
- $('#wlmcc').hide();
- $('.Sampling').hide();
- $('.noSampling').show();
- $("#dddd input[type=radio][value='12']").prop("checked", true);
- }
- });
- $("#customer_taxPointDes").change(function() {
- if($("#customer_taxPointDes").find("option:selected").text() == "二级商") {
- $("#bbb").show()
- } else {
- $("#bbb").hide()
- }
- })
- $("#customer_taxPointDes").change(function() {
- if($("#customer_taxPointDes").find("option:selected").text() == "种田大户") {
- $("#ccc").show()
- } else {
- $("#ccc").hide()
- }
- })
- $("#customer_feeEx").change(function() {
- if($("#customer_feeEx").find("option:selected").text() == "其他") {
- $("#ddd").show()
- } else {
- $("#ddd").hide()
- }
- })
- $("#customer_Qualification").change(function() {
- if($("#customer_Qualification").find("option:selected").text() == "其他") {
- $("#eee").show()
- } else {
- $("#eee").hide()
- }
- })
|