|
@@ -0,0 +1,977 @@
|
|
|
|
+/**
|
|
|
|
+ * 初始化销售渠道
|
|
|
|
+ */
|
|
|
|
+getCompany();
|
|
|
|
+/*===============================TDS 城市加载 -- start -- =============================== */
|
|
|
|
+$(function(){
|
|
|
|
+ $("#province").ProvinceCity();
|
|
|
|
+ $('.skin-minimal input').iCheck({
|
|
|
|
+ checkboxClass: 'icheckbox-blue',
|
|
|
|
+ radioClass: 'iradio-blue',
|
|
|
|
+ increaseArea: '20%'
|
|
|
|
+ });
|
|
|
|
+ $("#arrcity").suggest(citys,{hot_list:commoncitys,dataContainer:'#arrcity_3word',onSelect:function(result){
|
|
|
|
+ console.log($(this)[0].value);
|
|
|
|
+ $("#city2").click()
|
|
|
|
+ },
|
|
|
|
+ attachObject:'#suggest'
|
|
|
|
+ });
|
|
|
|
+ $("#city2").suggest(citys,{hot_list:commoncitys,attachObject:"#suggest2"})
|
|
|
|
+});
|
|
|
|
+/*===============================TDS 城市加载 -- start -- =============================== */
|
|
|
|
+
|
|
|
|
+/*===============================问题回复选择 -- start -- =============================== */
|
|
|
|
+$(document).on('click', '.dalog-ask .answer', function() {
|
|
|
|
+
|
|
|
|
+ initCity();//初始化城市
|
|
|
|
+ var QA_complaintId = $(this).find(".QA_complaintId").val();
|
|
|
|
+ var QA_smallClassId = $(this).find(".QA_smallClassId").val();
|
|
|
|
+ $("select[name='complaintId']").val(QA_complaintId);
|
|
|
|
+ initChannelType(QA_complaintId,QA_smallClassId); //初始化渠道类型
|
|
|
|
+
|
|
|
|
+ var questionId = $(this).find(".quesId").val();
|
|
|
|
+ var title = $(this).find("span").html();
|
|
|
|
+ var desc = $(this).find("#questionProfile").html();
|
|
|
|
+
|
|
|
|
+ $("#questionId").val(questionId);
|
|
|
|
+ $("#describeTitle").val(title);
|
|
|
|
+ UE.getEditor('describeContentText').setContent(desc);
|
|
|
|
+
|
|
|
|
+ //$("#answer-textarea").text();
|
|
|
|
+ $(".dalog-ask").hide(); //隐藏qa
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+var isInitSendAddressSms = false;
|
|
|
|
+
|
|
|
|
+/*处理结果的执行状态*/
|
|
|
|
+var isSolve = {
|
|
|
|
+ solved : [],
|
|
|
|
+ noSolved : [],
|
|
|
|
+ renewed : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","换新发货","发货通知用户","收货后回访"],
|
|
|
|
+ maintain : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","产线维修","换新发货","发货通知用户","收货后回访"],
|
|
|
|
+ reissue : ["录入客诉","生成E订单","督促仓库发货","仓库发货","发货通知用户","收货后回访"],
|
|
|
|
+ backGoods : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","退款","退货完成"],
|
|
|
|
+ noReasonBack : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","退款","退货完成"]
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*处理结果的变更状态 产品列表表头信息*/
|
|
|
|
+var isSolveTitleMsg = {
|
|
|
|
+ solved : [[],[]],
|
|
|
|
+ noSolved : [[],[]],
|
|
|
|
+ renewed : [["寄回产品","寄回产品颜色","退回产品配件","机器编码"],["寄出产品","寄出产品颜色","寄出产品配件"]],
|
|
|
|
+ maintain : [["寄回产品","寄回产品颜色","寄回产品配件","机器编码"],["寄出产品","寄出产品颜色","寄出产品配件"]],
|
|
|
|
+ reissue : [[],["补发产品","补发产品颜色","补发产品配件"]],
|
|
|
|
+ backGoods : [["退回产品","退回产品颜色","退回产品配件","机器编码"],[]],
|
|
|
|
+ noReasonBack : [["退回产品","退回产品颜色","退回产品配件","机器编码"],[]]
|
|
|
|
+}
|
|
|
|
+/*===============================定义全局变量以及监听事件和初始化 -- end -- =============================== */
|
|
|
|
+
|
|
|
|
+/*===============================正则表达式 -- start -- =============================== */
|
|
|
|
+var phoneReg = /^[1][3,4,5,7,8][0-9]{9}$/;
|
|
|
|
+var phoneReg2 = /(^[0-9]{3,4}\-[0-9]{3,8}$)|(^[0-9]{3,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}13[0-9]{9}$)/;
|
|
|
|
+/*===============================正则表达式 -- end -- =============================== */
|
|
|
|
+
|
|
|
|
+/*=============================== 页面加载完成启动事件 -- start -- =============================== */
|
|
|
|
+$(function (){
|
|
|
|
+ /* 所有trim_input 样式,input框都需要去除前后空格*/
|
|
|
|
+ $(".trim_input").change(function(){
|
|
|
|
+ var value = $.trim($(this).val());
|
|
|
|
+ $(this).val(value);
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ /*监听销售公司选择事件*/
|
|
|
|
+ $("#selectCompany").change(function (){
|
|
|
|
+ var companyId = $(this).val();
|
|
|
|
+ $("#companyId").val(companyId);
|
|
|
|
+ setStore(companyId,$("#selectStore")); //获取店铺
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ /*监听店铺选择事件*/
|
|
|
|
+ $("#selectStore").change(function (){
|
|
|
|
+ var storeId = $(this).val();
|
|
|
|
+ $("#storeId").val(storeId);
|
|
|
|
+ })
|
|
|
|
+})
|
|
|
|
+/*===============================页面加载完成启动事件 -- end -- =============================== */
|
|
|
|
+
|
|
|
|
+/*用于初始化监听回访信息的展示*/
|
|
|
|
+function initVisitEvent(){
|
|
|
|
+ $("input[name='customerIsVisit']").change(function (){
|
|
|
|
+ if($(this).val() == 2){
|
|
|
|
+ $("#needToVisit").css("display","block");
|
|
|
|
+ }else{
|
|
|
|
+ $("#needToVisit").css("display","none");
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*关闭qa*/
|
|
|
|
+function closeQA(){
|
|
|
|
+ $(".dalog-ask").hide(); //隐藏qa
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*初始化单选框样式*/
|
|
|
|
+function initCheck(){
|
|
|
|
+ $('.skin-minimal input').iCheck({
|
|
|
|
+ checkboxClass: 'icheckbox-blue',
|
|
|
|
+ radioClass: 'iradio-blue',
|
|
|
|
+ increaseArea: '20%'
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*初始化单选框样式*/
|
|
|
|
+function initCheckByNode(node){
|
|
|
|
+ $(node).iCheck({
|
|
|
|
+ checkboxClass: 'icheckbox-blue',
|
|
|
|
+ radioClass: 'iradio-blue',
|
|
|
|
+ increaseArea: '20%'
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+* type 1:不需要回访 2:需要回访
|
|
|
|
+* */
|
|
|
|
+function visitByType(type){
|
|
|
|
+ if(isUpdate && customerIsVisit){
|
|
|
|
+ customerIsVisit = false;
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if(1 == type){ //不需要回访
|
|
|
|
+ $("#customer-visit-2").iCheck('check'); //设置不需要回访
|
|
|
|
+ $("#needToVisit").css("display","none");
|
|
|
|
+ }else{
|
|
|
|
+ $("#customer-visit-1").iCheck('check'); //设置需要回访
|
|
|
|
+ $("#needToVisit").css("display","block");
|
|
|
|
+ }
|
|
|
|
+ initVisitEvent();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function initSysAdmin() {
|
|
|
|
+ sysAminList = getSysAdmin();
|
|
|
|
+ var html = "";
|
|
|
|
+ for(var i=0;i<sysAminList.length;i++){
|
|
|
|
+ var adminList = sysAminList[i];
|
|
|
|
+ if(adminId != null && adminId != "" && adminId != 0 && adminId == adminList.adminId ){
|
|
|
|
+ html += '<option value="'+ adminList.adminId +'" selected>'+ adminList.adminName +'(我)</option>';
|
|
|
|
+ }else{
|
|
|
|
+ html += '<option value="'+ adminList.adminId +'">'+ adminList.adminName +'</option>';
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ $("#adminId").html(html);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*初始化回访客服的选择*/
|
|
|
|
+function initVisitSysAdmin(){
|
|
|
|
+ var html = "";
|
|
|
|
+ var flag = false;
|
|
|
|
+ for(var i=0;i<sysAminList.length;i++){
|
|
|
|
+ var adminList = sysAminList[i];
|
|
|
|
+ if(adminId != null && adminId != "" && adminId != 0 && adminId == adminList.adminId ){
|
|
|
|
+ html += '<option value="'+ adminList.adminId +'" selected>'+ adminList.adminName +'(我)</option>';
|
|
|
|
+ flag = true;
|
|
|
|
+ }else{
|
|
|
|
+ html += '<option value="'+ adminList.adminId +'">'+ adminList.adminName +'</option>';
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ $("#visitAdminId").html(html);
|
|
|
|
+ if(flag){
|
|
|
|
+ showVisitMsg(1);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 用于显示回访指派任务提示信息
|
|
|
|
+ * 1 :自己
|
|
|
|
+ * 2 :其他人
|
|
|
|
+ */
|
|
|
|
+function showVisitMsg(type,adminName) {
|
|
|
|
+ if(type == 1){
|
|
|
|
+ $("#visitAdminIdMsg").html("您将为自己指定一个回访任务");
|
|
|
|
+ }else{
|
|
|
|
+ $("#visitAdminIdMsg").html("您将为"+ adminName +"指定一个回访任务");
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function getSysAdmin(){
|
|
|
|
+ if(sysAminList != null && sysAminList.length > 0){
|
|
|
|
+ return sysAminList;
|
|
|
|
+ }
|
|
|
|
+ $.ajax({
|
|
|
|
+ type: "POST",
|
|
|
|
+ data: {
|
|
|
|
+ },
|
|
|
|
+ url: url_path + "/admin/customer/select_sys_admin",
|
|
|
|
+ async: false,
|
|
|
|
+ success: function(data){
|
|
|
|
+ if (data.returnCode == 200) {
|
|
|
|
+ sysAminList = data.returnMsg.adminList;
|
|
|
|
+ adminId = data.returnMsg.adminId;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ error: function(XmlHttpRequest, textStatus, errorThrown){
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return sysAminList;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*初始化产品类型 -- 客诉头部的产品类型单选*/
|
|
|
|
+function initProduceType(){
|
|
|
|
+ $.ajax({
|
|
|
|
+ type: "POST",
|
|
|
|
+ data: {
|
|
|
|
+ },
|
|
|
|
+ url: url_path + "/admin/customer/select_produce_type",
|
|
|
|
+ success: function(data){
|
|
|
|
+ var html = "";
|
|
|
|
+ if (data.returnCode == 200) {
|
|
|
|
+ var check = "checked";
|
|
|
|
+ for(var i=0;i<data.returnMsg.productTypeList.length;i++){
|
|
|
|
+ var produce = data.returnMsg.productTypeList[i];
|
|
|
|
+ html += ' <div class="radio-box">' +
|
|
|
|
+ '<input type="radio" class="single_loading" id="produce-type-'+ i +'" name="typeId" typeCompany="'+ produce.typeCompany +'" datatype="*" value="'+ produce.typeId +'" '+ check +' nullmsg="请选择产品类型!" >' +
|
|
|
|
+ ' <label for="produce-type-'+ i +'">'+ produce.typeName +'</label>' +
|
|
|
|
+ ' </div>';
|
|
|
|
+ check = "";
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ html = '';
|
|
|
|
+ }
|
|
|
|
+ $("#produceTypeHtml").html(html);
|
|
|
|
+ initCheckByNode(".produce_type_html input");
|
|
|
|
+
|
|
|
|
+ /*绑定产品类型选择事件*/
|
|
|
|
+ $("input[name='typeId']").change(function (){
|
|
|
|
+ var typeId = parseInt($(this).val());
|
|
|
|
+ var isOrder = 1;
|
|
|
|
+ switch (typeId){ //1:Soodo电动牙刷 6:WaterO净水机 7:Aiberle净水机 9 :YULIA净水机
|
|
|
|
+ case 1:
|
|
|
|
+ isOrder = 2;
|
|
|
|
+ break;
|
|
|
|
+ case 6:
|
|
|
|
+ isOrder = 1;
|
|
|
|
+ break;
|
|
|
|
+ case 7:
|
|
|
|
+ isOrder = 1;
|
|
|
|
+ break;
|
|
|
|
+ case 9:
|
|
|
|
+ isOrder = 1;
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ opentionSelectOrder(isOrder);
|
|
|
|
+ })
|
|
|
|
+ /*当前第一个默认选中上朵电动牙刷 isNeedSelectOrder = 2 默认不需要选择订单*/
|
|
|
|
+ opentionSelectOrder(2);
|
|
|
|
+ },
|
|
|
|
+ error: function(XmlHttpRequest, textStatus, errorThrown){
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 选择处理结果-- 默认选择已解决
|
|
|
|
+ * type : 1 :已解决 2:未解决 3:换新 4:维修 5:补发 6:退货 7:无理由退货
|
|
|
|
+ */
|
|
|
|
+function initProcessResult(type){
|
|
|
|
+
|
|
|
|
+ if(type == null || type == ""){
|
|
|
|
+ type = 1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ allCustomerType = type;
|
|
|
|
+
|
|
|
|
+ if(allCustomerInfoType == null || allCustomerInfoType == ""){
|
|
|
|
+ allCustomerInfoType = $("input[name='customerCounselType']:checked").val();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var statusHtml = '<li><span class="arrow"></span><div class="number">status_index</div><div>status_html</div></li>';
|
|
|
|
+ var resultHtml = '';
|
|
|
|
+ var result = {};
|
|
|
|
+ var resultProductTableTitle = {};
|
|
|
|
+
|
|
|
|
+ $("#solved").show(); //已解决
|
|
|
|
+ $("#noSolved").show();//未解决
|
|
|
|
+ if(allCustomerInfoType == 1){ //售前
|
|
|
|
+ $("#renewed").hide();
|
|
|
|
+ $("#maintain").hide();
|
|
|
|
+ $("#reissue").hide();
|
|
|
|
+ $("#backGoods").hide();
|
|
|
|
+ $("#noReasonBack").hide();
|
|
|
|
+
|
|
|
|
+ switch(type)
|
|
|
|
+ {
|
|
|
|
+ case 1:
|
|
|
|
+ otherHied();
|
|
|
|
+ visitByType(1);
|
|
|
|
+ //getCompany();
|
|
|
|
+ break;
|
|
|
|
+ case 2:
|
|
|
|
+ otherHied();
|
|
|
|
+ visitByType(2);
|
|
|
|
+ //getCompany();
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }else if(allCustomerInfoType == 2){ //售后
|
|
|
|
+
|
|
|
|
+ if(!isInitSendAddressSms){
|
|
|
|
+ initComplaintQuestionInfo("m");
|
|
|
|
+ isInitSendAddressSms = true;
|
|
|
|
+ }
|
|
|
|
+ if(isUpdate){ //修改页面加载省市区
|
|
|
|
+ setAddressInfo(); //修改页面才会调用
|
|
|
|
+ }else{
|
|
|
|
+ /* 在选择售后类型是,直接初始化省市区,使用isInitAddress 变量来判断 */
|
|
|
|
+ if(isInitAddress == 0){
|
|
|
|
+ var proId = setPro(null,2);
|
|
|
|
+ var cityId = setCity(null,proId,2);
|
|
|
|
+ setDistrict(null,cityId,2);
|
|
|
|
+ isInitAddress = 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $("#renewed").show();
|
|
|
|
+ $("#maintain").show();
|
|
|
|
+ $("#reissue").show();
|
|
|
|
+ $("#backGoods").show();
|
|
|
|
+ $("#noReasonBack").show();
|
|
|
|
+ switch(type)
|
|
|
|
+ {
|
|
|
|
+ case 1:
|
|
|
|
+ otherHied();
|
|
|
|
+ visitByType(1);
|
|
|
|
+ //getCompany();
|
|
|
|
+ break;
|
|
|
|
+ case 2:
|
|
|
|
+ otherHied();
|
|
|
|
+ visitByType(2); //需要回访
|
|
|
|
+ //getCompany();
|
|
|
|
+ break;
|
|
|
|
+ case 3: //换新
|
|
|
|
+ result = isSolve.renewed;
|
|
|
|
+ resultProductTableTitle = isSolveTitleMsg.renewed;
|
|
|
|
+ $("#relationProduct").html("换新产品");
|
|
|
|
+ $("#processResultStatus").show();
|
|
|
|
+ $("#orderHead").show();
|
|
|
|
+ $("#order").show();
|
|
|
|
+ //$("#recipientInfo").show();
|
|
|
|
+ //$("#recipientInfoTitle").show();
|
|
|
|
+ //$("#recipientAddress").show();
|
|
|
|
+ //$("#recipientAddressText").show();
|
|
|
|
+ $("#renewedProduct").show();
|
|
|
|
+ $("#TDScollect").show();
|
|
|
|
+ $("#TDScollectShow").show();
|
|
|
|
+ $("#sendAddressInfo").show();
|
|
|
|
+ $("#sendAddressByPhone").show();
|
|
|
|
+ $("#updateProduct").hide(); //换新产品
|
|
|
|
+ $("#postageAccount").show(); //邮费转账账户
|
|
|
|
+ visitByType(2); //需要回访
|
|
|
|
+ //$("#salesChannelsSelect").hide(); //屏蔽销售公司
|
|
|
|
+ break;
|
|
|
|
+ case 4: //维修
|
|
|
|
+ result = isSolve.maintain;
|
|
|
|
+ resultProductTableTitle = isSolveTitleMsg.maintain;
|
|
|
|
+ $("#relationProduct").html("维修产品");
|
|
|
|
+ $("#processResultStatus").show();
|
|
|
|
+ $("#orderHead").show();
|
|
|
|
+ $("#order").show();
|
|
|
|
+ //$("#recipientInfo").show();
|
|
|
|
+ //$("#recipientInfoTitle").show();
|
|
|
|
+ //$("#recipientAddress").show();
|
|
|
|
+ //$("#recipientAddressText").show();
|
|
|
|
+ $("#renewedProduct").show();
|
|
|
|
+ $("#TDScollect").show();
|
|
|
|
+ $("#TDScollectShow").show();
|
|
|
|
+ $("#sendAddressInfo").show();
|
|
|
|
+ $("#sendAddressByPhone").show();
|
|
|
|
+ $("#updateProduct").hide();//维修产品
|
|
|
|
+ $("#postageAccount").show(); //邮费转账账户
|
|
|
|
+ visitByType(2); //需要回访
|
|
|
|
+ //$("#salesChannelsSelect").hide(); //屏蔽销售公司
|
|
|
|
+ break;
|
|
|
|
+ case 5://补发
|
|
|
|
+ result = isSolve.reissue;
|
|
|
|
+ resultProductTableTitle = isSolveTitleMsg.reissue;
|
|
|
|
+ $("#relationProduct").html("补发产品");
|
|
|
|
+ $("#processResultStatus").show();
|
|
|
|
+ $("#orderHead").show();
|
|
|
|
+ $("#order").show();
|
|
|
|
+ //$("#recipientInfo").show();
|
|
|
|
+ //$("#recipientInfoTitle").show();
|
|
|
|
+ // $("#recipientAddress").show();
|
|
|
|
+ // $("#recipientAddressText").show();
|
|
|
|
+ $("#renewedProduct").hide();
|
|
|
|
+ $("#TDScollect").show();
|
|
|
|
+ $("#TDScollectShow").show();
|
|
|
|
+ $("#sendAddressInfo").hide();
|
|
|
|
+ $("#sendAddressByPhone").hide();
|
|
|
|
+ $("#updateProduct").hide();
|
|
|
|
+ $("#postageAccount").hide(); //邮费转账账户 -- 隐藏
|
|
|
|
+ visitByType(2); //需要回访
|
|
|
|
+ $("#salesChannelsSelect").hide(); //屏蔽销售公司
|
|
|
|
+ break;
|
|
|
|
+ case 6: //退货
|
|
|
|
+ result = isSolve.backGoods;
|
|
|
|
+ resultProductTableTitle = isSolveTitleMsg.backGoods;
|
|
|
|
+ $("#relationProduct").html("退货产品");
|
|
|
|
+ $("#processResultStatus").show();
|
|
|
|
+ $("#orderHead").show();
|
|
|
|
+ $("#order").show();
|
|
|
|
+ // $("#recipientInfo").show();
|
|
|
|
+ //$("#recipientInfoTitle").show();
|
|
|
|
+ //$("#recipientAddress").show();
|
|
|
|
+ //$("#recipientAddressText").show();
|
|
|
|
+ $("#renewedProduct").show();
|
|
|
|
+ $("#TDScollect").show();
|
|
|
|
+ $("#TDScollectShow").show();
|
|
|
|
+ $("#sendAddressInfo").show();
|
|
|
|
+ $("#sendAddressByPhone").show();
|
|
|
|
+ $("#updateProduct").hide();
|
|
|
|
+ $("#postageAccount").show(); //邮费转账账户
|
|
|
|
+ visitByType(2); //需要回访
|
|
|
|
+ //$("#salesChannelsSelect").hide(); //屏蔽销售公司
|
|
|
|
+ break;
|
|
|
|
+ case 7://无理由退货
|
|
|
|
+ result = isSolve.noReasonBack;
|
|
|
|
+ resultProductTableTitle = isSolveTitleMsg.noReasonBack;
|
|
|
|
+ $("#relationProduct").html("退货产品");
|
|
|
|
+ $("#processResultStatus").show();
|
|
|
|
+ $("#orderHead").show();
|
|
|
|
+ $("#order").show();
|
|
|
|
+ //$("#recipientInfo").show();
|
|
|
|
+ //$("#recipientInfoTitle").show();
|
|
|
|
+ //$("#recipientAddress").show();
|
|
|
|
+ //$("#recipientAddressText").show();
|
|
|
|
+ $("#renewedProduct").show();
|
|
|
|
+ $("#TDScollect").show();
|
|
|
|
+ $("#TDScollectShow").show();
|
|
|
|
+ $("#sendAddressInfo").show();
|
|
|
|
+ $("#sendAddressByPhone").show();
|
|
|
|
+ $("#updateProduct").hide();
|
|
|
|
+ $("#postageAccount").show(); //邮费转账账户
|
|
|
|
+ visitByType(2); //需要回访
|
|
|
|
+ //$("#salesChannelsSelect").hide(); //屏蔽销售公司
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for(var i=0;i< result.length;i++){
|
|
|
|
+ var html = statusHtml.replace("status_index",i+1);
|
|
|
|
+ html = html.replace("status_html",result[i]);
|
|
|
|
+ resultHtml += html;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(resultProductTableTitle != null && resultProductTableTitle.length > 0){
|
|
|
|
+ /* 根据处理类型来切换 产品列表的列名称 */
|
|
|
|
+ for(var i=0;i<resultProductTableTitle[0].length;i++){
|
|
|
|
+ $("#table1").find("th").eq(i).html(resultProductTableTitle[0][i]);
|
|
|
|
+ }
|
|
|
|
+ for(var i=0;i<resultProductTableTitle[1].length;i++){
|
|
|
|
+ $("#table2").find("th").eq(i).html(resultProductTableTitle[1][i]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $("#processResultStatus").html(resultHtml);
|
|
|
|
+
|
|
|
|
+ opentionSelectOrderDiv();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*已解决|未解决 */
|
|
|
|
+function otherHied(){
|
|
|
|
+ $("#salesChannelsSelect").show(); //展示销售公司
|
|
|
|
+ $("#processResultStatus").hide(); //处理结果的执行状态 已解决未解决没有该信息
|
|
|
|
+ $("#orderHead").hide();
|
|
|
|
+ $("#order").hide();
|
|
|
|
+ $("#recipientInfo").hide();
|
|
|
|
+ $("#recipientInfoTitle").hide();
|
|
|
|
+ $("#recipientAddress").hide();
|
|
|
|
+ $("#recipientAddressText").hide();
|
|
|
|
+ $("#renewedProduct").hide();
|
|
|
|
+ $("#TDScollect").show();
|
|
|
|
+ $("#TDScollectShow").show();
|
|
|
|
+ $("#sendAddressInfo").hide();
|
|
|
|
+ $("#sendAddressByPhone").hide();
|
|
|
|
+ $("#updateProduct").hide();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+/*初始化省份*/
|
|
|
|
+function initProvince() {
|
|
|
|
+ //默认为售前咨询
|
|
|
|
+ //var customerCounselTypeOverall = allCustomerInfoType;
|
|
|
|
+ var customerChannelCategory = null;
|
|
|
|
+ $.ajax({
|
|
|
|
+ type: "POST",
|
|
|
|
+ data: {
|
|
|
|
+ complaintConsultingType : customerChannelCategory
|
|
|
|
+ },
|
|
|
|
+ url: url_path + "/admin/complaintQuestion/list_complaintType",
|
|
|
|
+ async: true,
|
|
|
|
+ success: function(data){
|
|
|
|
+ var html = '<option value="">请选择省份</option>';
|
|
|
|
+ var id;
|
|
|
|
+ if (data.returnCode == 200) {
|
|
|
|
+ for(var i=0;i<data.returnMsg.complaintTypeInfoList.length;i++){
|
|
|
|
+ var complaintTypeInfo = data.returnMsg.complaintTypeInfoList[i];
|
|
|
|
+ if(i == 0 ){
|
|
|
|
+ id = complaintTypeInfo.complaintId;
|
|
|
|
+ }
|
|
|
|
+ html += '<option value="'+ complaintTypeInfo.complaintId +'">'+ complaintTypeInfo.complaintClassName +'</option>';
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ html = '';
|
|
|
|
+ }
|
|
|
|
+ $("[name='complaintId']").html(html);
|
|
|
|
+ },
|
|
|
|
+ error: function(XmlHttpRequest, textStatus, errorThrown){
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*初始化城市*/
|
|
|
|
+function initCity(complaintId,smallId){
|
|
|
|
+ if(complaintId == null || complaintId == ""){
|
|
|
|
+ var html = '<option value="">请选择城市</option>';
|
|
|
|
+ $("[name='smallClassId']").html(html);
|
|
|
|
+ }else{
|
|
|
|
+ $.ajax({
|
|
|
|
+ type: "POST",
|
|
|
|
+ data: {
|
|
|
|
+ complaintId : complaintId
|
|
|
|
+ },
|
|
|
|
+ url: url_path + "/admin/complaintQuestion/list_complaintSmallClass",
|
|
|
|
+ async: true,
|
|
|
|
+ success: function(data){
|
|
|
|
+ var html = '<option value="">请选择城市</option>';
|
|
|
|
+ if (data.returnCode == 200) {
|
|
|
|
+ for(var i=0;i<data.returnMsg.complaintSmallClassInfoList.length;i++){
|
|
|
|
+ var ComplaintSmallClassInfo = data.returnMsg.complaintSmallClassInfoList[i];
|
|
|
|
+ html += '<option value="'+ ComplaintSmallClassInfo.smallClassId +'">'+ ComplaintSmallClassInfo.smallClassName +'</option>';
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ html = '';
|
|
|
|
+ }
|
|
|
|
+ $("[name='smallClassId']").html(html);
|
|
|
|
+
|
|
|
|
+ if(smallId != null && smallId != "" && typeof(smallId)!="undefined" ){
|
|
|
|
+ $("select[name='smallClassId']").val(smallId);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ error: function(XmlHttpRequest, textStatus, errorThrown){
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*初始化渠道类别*/
|
|
|
|
+function initChannelCategory() {
|
|
|
|
+ //默认为售前咨询
|
|
|
|
+ //var customerCounselTypeOverall = allCustomerInfoType;
|
|
|
|
+ var customerChannelCategory = null;
|
|
|
|
+ $.ajax({
|
|
|
|
+ type: "POST",
|
|
|
|
+ data: {
|
|
|
|
+ complaintConsultingType : customerChannelCategory
|
|
|
|
+ },
|
|
|
|
+ url: url_path + "/admin/complaintQuestion/list_complaintType",
|
|
|
|
+ async: true,
|
|
|
|
+ success: function(data){
|
|
|
|
+ var html = '<option value="">请选择渠道类别</option>';
|
|
|
|
+ var id;
|
|
|
|
+ if (data.returnCode == 200) {
|
|
|
|
+ for(var i=0;i<data.returnMsg.complaintTypeInfoList.length;i++){
|
|
|
|
+ var complaintTypeInfo = data.returnMsg.complaintTypeInfoList[i];
|
|
|
|
+ if(i == 0 ){
|
|
|
|
+ id = complaintTypeInfo.complaintId;
|
|
|
|
+ }
|
|
|
|
+ html += '<option value="'+ complaintTypeInfo.complaintId +'">'+ complaintTypeInfo.complaintClassName +'</option>';
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ html = '';
|
|
|
|
+ }
|
|
|
|
+ $("[name='complaintId']").html(html);
|
|
|
|
+ },
|
|
|
|
+ error: function(XmlHttpRequest, textStatus, errorThrown){
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*显示小类*/
|
|
|
|
+function initChannelType(complaintId,smallId){
|
|
|
|
+ if(complaintId == null || complaintId == ""){
|
|
|
|
+ var html = '<option value="">请选择渠道类别</option>';
|
|
|
|
+ $("[name='smallClassId']").html(html);
|
|
|
|
+ }else{
|
|
|
|
+ $.ajax({
|
|
|
|
+ type: "POST",
|
|
|
|
+ data: {
|
|
|
|
+ complaintId : complaintId
|
|
|
|
+ },
|
|
|
|
+ url: url_path + "/admin/complaintQuestion/list_complaintSmallClass",
|
|
|
|
+ async: true,
|
|
|
|
+ success: function(data){
|
|
|
|
+ var html = '<option value="">请选择渠道类型</option>';
|
|
|
|
+ if (data.returnCode == 200) {
|
|
|
|
+ for(var i=0;i<data.returnMsg.customerChannelTypeList.length;i++){
|
|
|
|
+ var ComplaintSmallClassInfo = data.returnMsg.customerChannelTypeList[i];
|
|
|
|
+ html += '<option value="'+ ComplaintSmallClassInfo.smallClassId +'">'+ ComplaintSmallClassInfo.smallClassName +'</option>';
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ html = '';
|
|
|
|
+ }
|
|
|
|
+ $("[name='smallClassId']").html(html);
|
|
|
|
+
|
|
|
|
+ if(smallId != null && smallId != "" && typeof(smallId)!="undefined" ){
|
|
|
|
+ $("select[name='smallClassId']").val(smallId);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ error: function(XmlHttpRequest, textStatus, errorThrown){
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 设置市
|
|
|
|
+ * type 1:搜索订单赋值 2:只查询全部,默认第一个
|
|
|
|
+ */
|
|
|
|
+function setCity(cityName,proId,type) {
|
|
|
|
+ var cityId = '';
|
|
|
|
+ var city = listCity(proId,"");
|
|
|
|
+ var selectCity = new Array();
|
|
|
|
+ if(type == 1){
|
|
|
|
+ selectCity = listCity(proId,cityName);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(city!=null){
|
|
|
|
+ var cityHtml = ''
|
|
|
|
+ for(var i=0;i<city.length;i++){
|
|
|
|
+ cityHtml += '<option value="'+ city[i].cityId +'">'+ city[i].city +'</option>';
|
|
|
|
+ }
|
|
|
|
+ $("#city").html(cityHtml);
|
|
|
|
+ if(selectCity != null && selectCity.length > 0 ){
|
|
|
|
+ cityId = selectCity[0].cityId;
|
|
|
|
+ }else{
|
|
|
|
+ cityId = city[0].cityId;
|
|
|
|
+ }
|
|
|
|
+ $("#city option[value='" + cityId + "']").attr("selected","true");
|
|
|
|
+ }
|
|
|
|
+ return cityId;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*===============================客户信息提交 -- start -- =============================== */
|
|
|
|
+$(function(){
|
|
|
|
+ $("#form-customerInfoAdmin-add").Validform({
|
|
|
|
+ tiptype: function (msg, o, cssctl) {
|
|
|
|
+ if (o.type == 3) {//失败
|
|
|
|
+ layer.msg(msg, {icon: 5, time: 3000});
|
|
|
|
+ $(window).scrollTop(o.obj.offset().top - 40);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ datatype: {//自定义验证类型
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ ignoreHidden: true,
|
|
|
|
+ tipSweep: true, //若为true,则只在表单提交时验证
|
|
|
|
+ ajaxPost: true, //异步提交
|
|
|
|
+ beforeCheck: function (curform) { //验证通过之前执行的函数
|
|
|
|
+ },
|
|
|
|
+ beforeSubmit: function (curform) { //验证通过之后执行的函数
|
|
|
|
+ var flag = addCustomerReady();
|
|
|
|
+ if(!flag){
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ callback: function (data) {//异步回调函数
|
|
|
|
+ if (data) {
|
|
|
|
+ var index = layer.alert(data.resultMsg, function (index) {
|
|
|
|
+ if (data.resultCode == 200) {
|
|
|
|
+ location.href = url_path + "/admin/customer/select_customer_list";
|
|
|
|
+ } else if(data.resultCode == 505){
|
|
|
|
+ location.href = url_path + "/admin/customer/select_customer_list";
|
|
|
|
+ }else {
|
|
|
|
+ layer.close(index);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+/* 添加客诉的准备 */
|
|
|
|
+function addCustomerReady(){
|
|
|
|
+ //保存AQ
|
|
|
|
+ saveQuestion(2);
|
|
|
|
+
|
|
|
|
+ /* 是否需要添加订单,赋值 */
|
|
|
|
+ $("#isNeedSelectOrder").val(isNeedSelectOrder);
|
|
|
|
+
|
|
|
|
+ var phoneFlag = true;
|
|
|
|
+ $(".associated-phone").each(function () {
|
|
|
|
+ var phone = $(this).val();
|
|
|
|
+ if(phone != null && phone != "" && typeof (phone) != "undefined"){
|
|
|
|
+ if(phone.length != 11){
|
|
|
|
+ vailErrorMsg($(this),"手机号码格式不正确");
|
|
|
|
+ phoneFlag = false;
|
|
|
|
+ }
|
|
|
|
+ /*if (!phoneReg.test(phone)) {
|
|
|
|
+ vailErrorMsg($(this),"手机号码格式不正确");
|
|
|
|
+ phoneFlag = false;
|
|
|
|
+ }*/
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ if(!phoneFlag){
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /*验证来源入口*/
|
|
|
|
+ var customerSourceType = $("input:radio[name='customerSourceType']:checked").val();
|
|
|
|
+ if(customerSourceType == 3){
|
|
|
|
+ var customerSourceOld = $("#customerSourceOld").val();
|
|
|
|
+ if(customerSourceOld == null || customerSourceOld == "" || typeof(customerSourceOld)=="undefined"){
|
|
|
|
+ vailErrorMsg($("#customerSourceOld"),"未填写来源入口");
|
|
|
|
+ return false;
|
|
|
|
+ }else{
|
|
|
|
+ $("#customerSource").val(customerSourceOld);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /*根据产品类型,获取来源商城*/
|
|
|
|
+ var typeCompany = parseInt($("input:radio[name='typeId']:checked").attr("typeCompany"));
|
|
|
|
+ $("#typeCompany").val(typeCompany);
|
|
|
|
+
|
|
|
|
+ /*----TDS收集模块--start-----*/
|
|
|
|
+ var valicity = $(".ac_result_tip").html();
|
|
|
|
+ if(valicity == null || valicity == "" || typeof(valicity)=="undefined"){
|
|
|
|
+ $("#TDSArea").html("");
|
|
|
|
+ }else if(valicity.indexOf("对不起,找不到") > 0 ){
|
|
|
|
+ $("#TDSArea").html("");
|
|
|
|
+ $("#customerArea").val("");
|
|
|
|
+ }else{
|
|
|
|
+ var TDSArea = $("#TDSArea").find("option:selected").text();
|
|
|
|
+ if(TDSArea != null && TDSArea != ""){
|
|
|
|
+ var area = TDSCity + "-" + TDSArea
|
|
|
|
+ $("#customerArea").val(area);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ /*----TDS收集模块--end-----*/
|
|
|
|
+
|
|
|
|
+ /* 地址拼接 */
|
|
|
|
+ var province = $("#province").find("option:selected").text();
|
|
|
|
+ var city = $("#city").find("option:selected").text();
|
|
|
|
+ var district = $("#district").find("option:selected").text();
|
|
|
|
+ var relationSendMergeAddress = province + "-" + city + "-" + district;
|
|
|
|
+ $("#relationSendMergeAddress").val(relationSendMergeAddress);
|
|
|
|
+ /* 地址拼接 */
|
|
|
|
+
|
|
|
|
+ /*----问题描述- start --*/
|
|
|
|
+ var quId = $("#questionId").val();
|
|
|
|
+ if(quId == null || quId == ""){
|
|
|
|
+ vailErrorMsg($("#questionId"),"未保存QA!");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ var describeContentText = UE.getEditor('describeContentText').getContent();
|
|
|
|
+ if(describeContentText == null || describeContentText == ""){
|
|
|
|
+ //layer.msg("未填写问题描述", {icon: 5, time: 3000});
|
|
|
|
+ vailErrorMsg($("#describeTitle"),"未填写问题描述");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if(describeContentText.length > 3000){
|
|
|
|
+ vailErrorMsg($("#describeContent"),"问题回复最大支持3000个字符");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ $("#describeContent").val(describeContentText);
|
|
|
|
+ /*----问题描述--end-----*/
|
|
|
|
+
|
|
|
|
+ /*----处理描述- start --*/
|
|
|
|
+ var describeHandleDescText = UE.getEditor('describeHandleDescText').getContent();
|
|
|
|
+ if(describeHandleDescText.length > 3000){
|
|
|
|
+ vailErrorMsg($("#describeHandleDesc"),"问题描述最大支持3000个字符");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ $("#describeHandleDesc").val(describeHandleDescText);
|
|
|
|
+ /*----处理描述--end-----*/
|
|
|
|
+
|
|
|
|
+ /* --- 类型:售后 处理结果:维修/换新/补发/退货/无理由退货 -- 处理产品 start---- */
|
|
|
|
+
|
|
|
|
+ if(isNeedSelectOrder == 1) { //需要订单
|
|
|
|
+
|
|
|
|
+ var sendProdcues = new Array(); //寄出产品表
|
|
|
|
+ var sendFittings = new Array();
|
|
|
|
+ var closedProdcues = new Array(); //获取寄回,寄出直接复制寄回
|
|
|
|
+ var closedFittings = new Array(); //获取寄回,寄出直接复制寄回
|
|
|
|
+
|
|
|
|
+ $("#addProduct").find(".input-number").each(function () {
|
|
|
|
+ var machineNo = $(this).val(); //机器编号
|
|
|
|
+ var number = $(this).attr("number"); //机器编号
|
|
|
|
+ var itemIsSource = $(this).attr("itemissource"); //是否为配件 1:产品颜色表,2:配件表
|
|
|
|
+ if (number != null && number != "" && number != 0) {
|
|
|
|
+ var product = new Object();
|
|
|
|
+ var fittings = new Object();
|
|
|
|
+ product.productId = $(this).parent().find(".input-produce-id").val();
|
|
|
|
+ product.colorId = $(this).parent().find(".input-fc-id").val();
|
|
|
|
+ fittings.productId = $(this).parent().find(".input-produce-id").val();
|
|
|
|
+ fittings.fittingsId = $(this).parent().find(".input-fc-id").val();
|
|
|
|
+ if(itemIsSource == 1){ //产品颜色
|
|
|
|
+ product.sendProdcueNumber = number;
|
|
|
|
+ product.closedProdcueNumber = number;
|
|
|
|
+ product.closedProdcueMachineNo = machineNo;
|
|
|
|
+ //换新、维修,退货,无理由退货,
|
|
|
|
+ if (allCustomerType == 3 || allCustomerType == 4 ){ //换新/维修
|
|
|
|
+ sendProdcues.push(product);
|
|
|
|
+ closedProdcues.push(product);
|
|
|
|
+ }else if(allCustomerType == 6 || allCustomerType == 7){
|
|
|
|
+ closedProdcues.push(product);
|
|
|
|
+ }else if(allCustomerType == 5){ //补发
|
|
|
|
+ sendProdcues.push(product);
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ fittings.sendFittingNumber = number;
|
|
|
|
+ fittings.closedFittingNumber = number;
|
|
|
|
+ //换新、维修,退货,无理由退货,
|
|
|
|
+ if (allCustomerType == 3 || allCustomerType == 4 ) { //换新/维修
|
|
|
|
+ sendFittings.push(fittings);
|
|
|
|
+ closedFittings.push(fittings);
|
|
|
|
+ }else if(allCustomerType == 6 || allCustomerType == 7){
|
|
|
|
+ closedFittings.push(fittings);
|
|
|
|
+ }else if(allCustomerType == 5){ //补发
|
|
|
|
+ sendFittings.push(fittings);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ var backErrorMsg = "请选择一个replace_error_msg寄回的产品或配件并填写一个以上的数量!"
|
|
|
|
+ var sendErrorMsg = "请选择一个replace_error_msg寄送的产品或配件并填写一个以上的数量!"
|
|
|
|
+ var process = true;
|
|
|
|
+ switch (allCustomerType) {
|
|
|
|
+ case 3:
|
|
|
|
+ process = processIsEmpty([closedProdcues, closedFittings]);
|
|
|
|
+ if (!process) {
|
|
|
|
+ var msg = backErrorMsg.replace("replace_error_msg", "换新");
|
|
|
|
+ layer.msg(msg, {icon: 5, time: 3000});
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ process = processIsEmpty([sendProdcues, sendFittings]);
|
|
|
|
+ if (!process) {
|
|
|
|
+ var msg = sendErrorMsg.replace("replace_error_msg", "换新");
|
|
|
|
+ layer.msg(msg, {icon: 5, time: 3000});
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 4:
|
|
|
|
+ process = processIsEmpty([closedProdcues, closedFittings]);
|
|
|
|
+ if (!process) {
|
|
|
|
+ var msg = backErrorMsg.replace("replace_error_msg", "维修");
|
|
|
|
+ layer.msg(msg, {icon: 5, time: 3000});
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ process = processIsEmpty([sendProdcues, sendFittings]);
|
|
|
|
+ if (!process) {
|
|
|
|
+ var msg = sendErrorMsg.replace("replace_error_msg", "维修");
|
|
|
|
+ layer.msg(msg, {icon: 5, time: 3000});
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 5:
|
|
|
|
+ process = processIsEmpty([sendProdcues, sendFittings]);
|
|
|
|
+ if (!process) {
|
|
|
|
+ var msg = sendErrorMsg.replace("replace_error_msg", "补发");
|
|
|
|
+ layer.msg(msg, {icon: 5, time: 3000});
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 6:
|
|
|
|
+ process = processIsEmpty([closedProdcues, closedFittings]);
|
|
|
|
+ if (!process) {
|
|
|
|
+ var msg = backErrorMsg.replace("replace_error_msg", "退货");
|
|
|
|
+ layer.msg(msg, {icon: 5, time: 3000});
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 7:
|
|
|
|
+ process = processIsEmpty([closedProdcues, closedFittings]);
|
|
|
|
+ if (!process) {
|
|
|
|
+ var msg = backErrorMsg.replace("replace_error_msg", "退货");
|
|
|
|
+ layer.msg(msg, {icon: 5, time: 3000});
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ $("#sendProdcues").val(JSON.stringify(sendProdcues));
|
|
|
|
+ $("#sendFittings").val(JSON.stringify(sendFittings));
|
|
|
|
+ $("#closedProdcues").val(JSON.stringify(closedProdcues));
|
|
|
|
+ $("#closedFittings").val(JSON.stringify(closedFittings));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var visitTimeSelect = $("input[name='visitTimeSelect']:checked").val();
|
|
|
|
+ var visit_date = $('#datemin').val();
|
|
|
|
+ var myDate = new Date();
|
|
|
|
+ var date = myDate.getFullYear()+"-"+(myDate.getMonth()+1)+"-"+myDate.getDate();
|
|
|
|
+ var hours = myDate.getHours();
|
|
|
|
+ //如果两个时间相等,则判断可选的回访时间
|
|
|
|
+ if(Date.parse(visit_date) == Date.parse(date)){
|
|
|
|
+ var msg = "该时间已超过当前时间,请重新选择回访时间!";
|
|
|
|
+ if (hours > 12 && visitTimeSelect == 1) {
|
|
|
|
+ vailErrorMsg($("#datemin"),msg);
|
|
|
|
+ return false;
|
|
|
|
+ } else if (hours > 14 && visitTimeSelect == 2) {
|
|
|
|
+ vailErrorMsg($("#datemin"),msg);
|
|
|
|
+ return false;
|
|
|
|
+ } else if (hours > 18 && visitTimeSelect == 3) {
|
|
|
|
+ vailErrorMsg($("#datemin"),msg);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/* 判断产品与配件是否填入值 */
|
|
|
|
+function processIsEmpty(process){
|
|
|
|
+ if(process != null && process != "" && process.length > 0){
|
|
|
|
+ var flag = 2;
|
|
|
|
+ var num = 0;
|
|
|
|
+ if(process[0] == null || process[0].length < 1 ){
|
|
|
|
+ flag -- ;
|
|
|
|
+ }
|
|
|
|
+ if(process[1] == null || process[1].length < 1 ){
|
|
|
|
+ flag -- ;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for(var j=0; j<process.length;j++){
|
|
|
|
+ for(var i=0;i<process[j].length;i++){
|
|
|
|
+ if(process[j][i].sendProdcueNumber !== undefined){
|
|
|
|
+ num += process[j][i].sendProdcueNumber;
|
|
|
|
+ }
|
|
|
|
+ if(process[j][i].sendFittingNumber !== undefined){
|
|
|
|
+ num += process[j][i].sendFittingNumber;
|
|
|
|
+ }
|
|
|
|
+ if(process[j][i].closedProdcueNumber !== undefined){
|
|
|
|
+ num += process[j][i].closedProdcueNumber ;
|
|
|
|
+ }
|
|
|
|
+ if(process[j][i].closedFittingNumber !== undefined){
|
|
|
|
+ num += process[j][i].closedFittingNumber;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(flag == 0){
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if(num == 0){
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+}
|
|
|
|
+/*===============================客诉提交 -- end -- =============================== */
|