| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974 |
- /**
- * 修改工单
- * */
- //获取 id
- var oid = helper.request.queryString("oid");
- $(function() {
-
- autosize($('textarea'));
- $.when(helper.getDropList.getlistDropByDic($('#order_source'), 'GDLY'),
- helper.getDropList.getlistDropByDic($('#order_handle'), 'YWLX'),
- helper.getDropList.getOrderRadios($('#order_type'), 'GDLX', 'inlineRadioOptions'))
- .then(function() {
- if(oid) {
- getWorkOrderDetails(oid); //获取工单信息
- }
- });
- });
- //**所有input去掉自动填充
- $(function(){
- $('input:not([autocomplete]),textarea:not([autocomplete]),select:not([autocomplete])').attr('autocomplete', 'off');
- });
- function clearInter() {
- clearInterval(timer);
- }
- var callId = helper.request.queryString("cid");
- //保存按钮
- $('#save_order').click(function() {
- orderSave();
- });
- //投诉和抽检客户 物料编号清空
- 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') {
- 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_Quantity').val(); //问题数量
- coint = $('#xiaosh').val(); //销售基地
- daqu = '';
- fengo = '';
- jyppai = '';
- cttt = '';
- shengch = '';
- emptyct()
- $('#wlbm').hide();
- $('#wlmcc').hide();
- $('#clie').hide();
- $('#mate').hide();
- // alert(catt)
- }
- }
- // 保存
- function orderSave() {
- typePro();
- var oid = helper.request.queryString("oid");
- var isDetail = helper.request.queryString("isDetail");
- // if(!regexs.userNameReg.test($.trim($('#order_name').val()))) {
- // layer.confirm('请输入有效的客户姓名(2-20位汉字可以包含·•)!', {
- // icon: 2,
- // btn: ['确定']
- // });
- // return;
- // }
- var order_handle = $('#order_handles').is(':visible') ? $('#order_handle').val() : 0;
- $.post(huayi.config.callcenter_url + "WorkOrderNew/Update", {
- F_ID: oid, //int 工单id;
- F_Source: $('#godanlx').val(), // 工单来源
- F_WorkOrderCode: $('#gdbian').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_WorkerBrand:$("#ord_pait").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(), //公关费用金额
- token: $.cookie("token")
- }, function(result) {
- result = $.parseJSON(result);
- if(result.state.toLowerCase() == "success") {
- if(isDetail === "true") {
- parent.parent.layer.closeAll();
- parent.parent.$('#derlist').bootstrapTable('refresh');
- parent.parent.layer.msg("修改成功");
- } else {
- var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- parent.layer.close(index); //再执行关闭
- parent.$('#workorderlist').bootstrapTable('refresh');
- parent.$('.Closed').trigger('click');
- parent.layer.msg("保存成功");
- }
- // top.workcount();
- }
- })
- }
- //获取工单详情
- function getWorkOrderDetails(oid) {
- $.getJSON(huayi.config.callcenter_url + 'WorkOrderNew/GetDetails', {
- id: oid,
- "token": $.cookie("token")
- }, function(result) {
- if(result.state.toLowerCase() == "success") {
- if(result.rows && result.rows.length > 0) {
- var data = result.rows[0];
- $("#lygon").val(data.F_SourceName); //工单来源
- $('#gdbian').val(data.F_WorkOrderCode); // 工单编号
- // 咨询模块
- $("#category option:selected").text(data.F_QuestionType); // 问题类别
- $("#category option:selected").val(data.F_QuestionType); //问题类别
- $("#ProductName option:selected").text(data.F_TS_Category); // 产品名称
- $("#ProductName option:selected").val(data.F_TS_Category); //产品名称
- $('#Product_Quantity').val(data.F_ZX_Quantity); //问题数量
- $("#xiaoshou option:selected").text(data.F_SalesBase); // 销售基地
- $("#xiaoshou option:selected").val(data.F_SalesBase); //销售基地
- // 投诉模块
- $("#product_name option:selected").text(data.F_TS_Category); // 产品名称
- $("#product_name option:selected").val(data.F_TS_Category); // 产品名称
- $('#quantity').val(data.F_TS_Quantity); //问题数量
- $('#Batch_number').val(data.F_BatchNumber); //生产批次
- $("#Sales_base option:selected").text(data.F_SalesBase); // 销售基地
- $("#Sales_base option:selected").val(data.F_SalesBase); // 销售基地
- $("#level option:selected").text(data.F_TS_Level); // 重要级别
- $("#level option:selected").val(data.F_TS_Level); // 重要级别
- $("#ord_pait").val(data.F_WorkerBrand); // 重要级别
-
- $("#cat option:selected").text(data.F_QuestionTypeone); // 问题类别1
- $("#cat option:selected").val(data.F_QuestionTypeone); // 问题类别1
- $("#catego option:selected").text(data.F_QuestionTypetwo); // 问题类别2
- $("#catego option:selected").val(data.F_QuestionTypetwo); // 问题类别2
- $("#cate option:selected").text(data.F_QuestionType); // 问题类别3
- $("#cate option:selected").val(data.F_QuestionType); // 问题类别3
- // 抽检模块
- // $("#chou_wtlb option:selected").text(data.F_QuestionType); // 问题类别
- // $("#chou_wtlb option:selected").val(data.F_QuestionType); // 问题类别
- $("#der_level option:selected").text(data.F_CJ_Level); // 抽检级别
- $("#der_level option:selected").val(data.F_CJ_Level); // 抽检级别
- $('#batch_num').val(data.F_BatchNumber); //生产批次号位
- $("#der_Company option:selected").text(data.F_CJ_Unit); // 抽检单位
- $("#der_Company option:selected").val(data.F_CJ_Unit); // 抽检单位
- $('#der_Test').val(data.F_CJ_TestUnit); //化验单位
- $('#der_Tonnage').val(data.F_CJ_Tonnage); //抽检吨数
- $('#der_Ton').val(data.F_CJ_BagNo); //抽检袋数
- $('#der_Amount').val(data.F_CJ_Outlay); //公关费用金额
- $('#der_time').val(data.F_CJ_Time); //抽检时间
- // 建议及其他
- $("#cateq option:selected").text(data.F_QuestionType); // 问题类别
- $("#cateq option:selected").val(data.F_QuestionTypeid); // 问题类别
- $("#Produ_ctName option:selected").text(data.F_TS_Category); // 产品名称
- $("#Produ_ctName option:selected").val(data.F_TS_Category); // 产品名称
- $('#Product_Quan').val(); //问题数量
- $("#xiaosh option[value='" + data.F_SalesBase + "']").attr("selected", "selected"); // 销售基地
- // 公共模块
- $('#number').val(data.F_CustomerID); //客户编码
- $('#salesman').val(data.F_Salesman); //业务员
- $('#telephone').val(data.F_SalesPhone); //电话
- $("#chdaqu option:selected").text(data.F_AreaName); // 大区
- $("#chdaqu option:selected").val(data.F_AreaName); // 大区
- $("#chfen option:selected").text(data.F_BranchName); // 分公司
- $("#chfen option:selected").val(data.F_BranchName); // 分公司
- $('#manage').val(data.F_Brand); //经营品牌
- //物料
- $('#Code').val(data.F_MaterialID); //物料编码
- $('#material_name').val(data.F_MaterialName); //物料名称
- $('#model_number').val(data.F_Model); //型号
- $('#specifications').val(data.F_Specs); //规格
- $('#category1').val(data.F_Level1); //一级分类
- $('#category2').val(data.F_Level2); //二级分类
- $('#category3').val(data.F_Level3); //三级分类
- $('#brand_name').val(data.F_Brand); //品牌
- $('#efficiency').val(data.F_MaterialEffect); //复合肥肥效
- $('#product_line').val(data.F_Pipeline); //产品线
- $('#process').val(data.F_Craft); //工艺
- $('#enter_formula').val(data.F_TS_Formula); //配方
- $('#kehuxing').val(data.F_CusName); //客户姓名
- $('#kehudian').val(data.F_CusPhone); //客户电话
- $('#order_company').val(data.F_CompanyName), //公司名称
- $("#sheng option:selected").text(data.F_IncidentProvince); // 省
- $("#sheng option:selected").val(data.F_IncidentProvince); // 省
- $("#shi option:selected").val(data.F_IncidentCity); // 市
- $("#shi option:selected").text(data.F_IncidentCity); // 市
- $("#quxian option:selected").val(data.F_IncidentCountry); //县
- $("#quxian option:selected").text(data.F_IncidentCountry); //县
- $("#xiang option:selected").val(data.F_IncidentTownship); //乡镇
- $("#xiang option:selected").text(data.F_IncidentTownship); //乡镇
- $("#xiangxi").val(data.F_IncidentDetailed); //详细
- $('#reception').val(data.F_Description); //问题描述
- if(data.F_TypeName === "咨询") {
- $("input[type=radio][value='1']").prop("checked", true);
- $('#PageArrival').show(); //receive
- $('#Duration').hide();
- $('#Depth').hide();
- $('#Page').hide();
- $('#wlbm').hide();
- $('#wlmcc').hide();
- } else if(data.F_TypeName === "投诉") {
- $("input[type=radio][value='2']").prop("checked", true);
- $('#PageArrival').hide(); //receive
- $('#Duration').show();
- $('#Depth').hide();
- $('#Page').hide();
- $('#wlbm').show();
- $('#wlmcc').show();
- } else if(data.F_TypeName === "抽检") {
- $("input[type=radio][value='3']").prop("checked", true);
- $('#PageArrival').hide(); //receive
- $('#Duration').hide();
- $('#Depth').show();
- $('#Page').hide();
- $('#wlbm').show();
- $('#wlmcc').show();
- } else if(data.F_TypeName === "建议及其他") {
- $("input[type=radio][value='4']").prop("checked", true);
- $('#PageArrival').hide(); //receive
- $('#Duration').hide();
- $('#Depth').hide();
- $('#Page').show();
- $('#wlbm').hide();
- $('#wlmcc').hide();
- }
- }
- }
- });
- }
- //三级联动下拉
- $(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($("#chdaqu"));
- //投诉模块
- 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"));
- ZXWTLB($("#cateq")); //建议问题类别
- });
- // 客户信息里的 省/市/区/县
- // 咨询模块 省
- 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 LB12(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");
- })
- LB12($("#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: $("#chdaqu").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);
- })
- }
- })
- }
- $('#chdaqu').on('change', function() {
- $.getJSON(huayi.config.callcenter_url + "Department/GetList", {
- "token": $.cookie("token"),
- F_Layer: 2,
- F_DeptName: $("#chdaqu").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("#chfen");
- })
- FENGONGSI($("#chfen"));
- }
- })
- });
- //抽检问题类别
- 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);
- })
- }
- })
- }
- //工单类型点选
- $('.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();
- } else if($(this).val() === "2") { //投诉
- $('#PageArrival').hide(); //receive
- $('#Duration').show();
- $('#Depth').hide();
- $('#Page').hide();
- $('#wlbm').show();
- $('#wlmcc').show();
- } else if($(this).val() === "3") { //抽检
- $('#PageArrival').hide(); //receive
- $('#Duration').hide();
- $('#Depth').show();
- $('#Page').hide();
- $('#wlbm').show();
- $('#wlmcc').show();
- } else if($(this).val() === "4") { //建议其他
- $('#PageArrival').hide(); //receive
- $('#Duration').hide();
- $('#Depth').hide();
- $('#Page').show();
- $('#wlbm').hide();
- $('#wlmcc').hide();
- }
- });
- $('#number').blur(function () {
-
-
- //根据客户编码获取信息
- $.getJSON(huayi.config.callcenter_url + "CustomerNew/GetCodeCustomer", {
- // id: ids, //id
- code:$('#number').val(),
- token: $.cookie("token")
- }, function(data) {
- if (data.state.toLowerCase() == "success") {
- data = data.data;
- if (data) {
- $('#salesman').val(data.F_Salesman);
- $('#telephone').val(data.F_SalesPhone);
- // $('#chdaqu').text(data.F_AreaName);
- $("#chdaqu option:selected").text(data.F_AreaName);
- $("#chfen option:selected").text(data.F_BranchName);
- $("#chfen option:selected").val(data.F_BranchName);
- // $('#chfen').text(data.F_BranchName);
- $('#manage').val(data.F_Brands);
- $('#order_company').val(data.F_CompanyName);
- }else{
- $('#salesman').val('');
- $('#telephone').val('');
- $('#chdaqu').find("option:selected").attr("selected", false);
- // $("#chdaqu").val('');
- $("#chfen").val('');
- $('#manage').val('');
- $('#order_company').val('');
- }
- }
- // alert(111111111111111);
- });
-
- });
- $('#Code').blur(function () {
- // alert($(this).val());
- // $('#material').show();
-
- //根据物料编码获取信息
- $.getJSON(huayi.config.callcenter_url + "MaterialManage/GetCodeModel", {
- // id: ids, //id
- code:$('#Code').val(),
- token: $.cookie("token")
- }, function(data) {
- if (data.state.toLowerCase() == "success") {
- data = data.data;
- if (data) {
- $("#material_name").val(data.model.F_MaterialName);//物料名称
- $("#model_number").val(data.model.F_Model),//型号
- $("#specifications").val(data.model.F_Specs);//规格
- $("#category1").val(data.model.F_Level1);//一级分类
- $("#category2").val(data.model.F_Level2);//二级分类
- $("#category3").val(data.model.F_Level3);//三级分类
- $('#brand_name').val(data.model.F_Brand);//品牌
- $('#efficiency').val(data.model.F_MaterialEffect); //复合肥肥效
- $('#product_line').val(data.model.F_Pipeline); //产品线tensions
- $("#process").val(data.model.F_Craft);//工艺
- $("#enter_formula").val(data.model.F_Craft);//工艺
- }else{
- $("#material_name").val('');//物料名称
- $("#model_number").val(''),//型号
- $("#specifications").val('');//规格
- $("#category1").val('');//一级分类
- $("#category2").val('');//二级分类
- $("#category3").val('');//三级分类
- $('#brand_name').val('');//品牌
- $('#efficiency').val(''); //复合肥肥效
- $('#product_line').val(''); //产品线tensions
- $("#process").val('');//工艺
- $("#enter_formula").val('');//工艺
- }
- }
- // alert(111111111111111);
- });
-
- });
|