|
@@ -181,26 +181,26 @@ var isInitSendAddressSms = false;
|
|
|
|
|
|
/*===============================定义全局变量以及监听事件和初始化 -- start -- =============================== */
|
|
|
/*处理结果的执行状态*/
|
|
|
-var isSolve = {
|
|
|
- solved : [],
|
|
|
- noSolved : [],
|
|
|
- renewed : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","换新发货","发货通知用户","收货后回访"],
|
|
|
- maintain : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","产线维修","换新发货","发货通知用户","收货后回访"],
|
|
|
- reissue : ["录入客诉","生成E订单","督促仓库发货","仓库发货","发货通知用户","收货后回访"],
|
|
|
- backGoods : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","退款","退货完成"],
|
|
|
- noReasonBack : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","退款","退货完成"]
|
|
|
-}
|
|
|
+// var isSolve = {
|
|
|
+// solved : [],
|
|
|
+// noSolved : [],
|
|
|
+// renewed : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","换新发货","发货通知用户","收货后回访"],
|
|
|
+// maintain : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","产线维修","换新发货","发货通知用户","收货后回访"],
|
|
|
+// reissue : ["录入客诉","生成E订单","督促仓库发货","仓库发货","发货通知用户","收货后回访"],
|
|
|
+// backGoods : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","退款","退货完成"],
|
|
|
+// noReasonBack : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","退款","退货完成"]
|
|
|
+// }
|
|
|
|
|
|
/*处理结果的变更状态 产品列表表头信息*/
|
|
|
-var isSolveTitleMsg = {
|
|
|
- solved : [[],[]],
|
|
|
- noSolved : [[],[]],
|
|
|
- renewed : [["寄回产品","寄回产品颜色","退回产品配件","机器编码"],["寄出产品","寄出产品颜色","寄出产品配件"]],
|
|
|
- maintain : [["寄回产品","寄回产品颜色","寄回产品配件","机器编码"],["寄出产品","寄出产品颜色","寄出产品配件"]],
|
|
|
- reissue : [[],["补发产品","补发产品颜色","补发产品配件"]],
|
|
|
- backGoods : [["退回产品","退回产品颜色","退回产品配件","机器编码"],[]],
|
|
|
- noReasonBack : [["退回产品","退回产品颜色","退回产品配件","机器编码"],[]]
|
|
|
-}
|
|
|
+// var isSolveTitleMsg = {
|
|
|
+// solved : [[],[]],
|
|
|
+// noSolved : [[],[]],
|
|
|
+// renewed : [["寄回产品","寄回产品颜色","退回产品配件","机器编码"],["寄出产品","寄出产品颜色","寄出产品配件"]],
|
|
|
+// maintain : [["寄回产品","寄回产品颜色","寄回产品配件","机器编码"],["寄出产品","寄出产品颜色","寄出产品配件"]],
|
|
|
+// reissue : [[],["补发产品","补发产品颜色","补发产品配件"]],
|
|
|
+// backGoods : [["退回产品","退回产品颜色","退回产品配件","机器编码"],[]],
|
|
|
+// noReasonBack : [["退回产品","退回产品颜色","退回产品配件","机器编码"],[]]
|
|
|
+// }
|
|
|
/*===============================定义全局变量以及监听事件和初始化 -- end -- =============================== */
|
|
|
|
|
|
/*===============================正则表达式 -- start -- =============================== */
|
|
@@ -403,28 +403,35 @@ function initProduceType(){
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 选择处理结果-- 默认选择已解决
|
|
|
- * type : 1 :已解决 2:未解决 3:换新 4:维修 5:补发 6:退货 7:无理由退货
|
|
|
+ *
|
|
|
*/
|
|
|
-function initProcessResult(type,allCustomerInfoType){
|
|
|
+function ulcProcessResult(data){
|
|
|
+ initProcessResult(data[1].procMethodIsBack,data[1].procMethodIsSend);
|
|
|
+}
|
|
|
|
|
|
- if(type == null || type == ""){
|
|
|
- type = 1;
|
|
|
+/**
|
|
|
+ * 选择处理结果-- 默认选择已解决
|
|
|
+ * type : 1 :已解决 2:未解决 3:换新 4:维修 5:补发 6:退货 7:无理由退货 -- 删除
|
|
|
+ * procMethodIsBack : 是否需要寄回 1:需要寄回 2:不需要寄回
|
|
|
+ * procMethodIsSend : 是否需要寄出 1:需要寄出 2:不需要寄出
|
|
|
+ */
|
|
|
+function initProcessResult(procMethodIsBack,procMethodIsSend){
|
|
|
+ if(procMethodIsBack == null || procMethodIsBack == ""){
|
|
|
+ procMethodIsBack = 1;
|
|
|
+ }
|
|
|
+ if(procMethodIsSend == null || procMethodIsSend == ""){
|
|
|
+ procMethodIsSend = 1;
|
|
|
}
|
|
|
- var customerInfoType = allCustomerInfoType;
|
|
|
- allCustomerType = type;
|
|
|
+
|
|
|
+ allProcMethodIsBack=procMethodIsBack;
|
|
|
+ allProcMethodIsSend=procMethodIsSend;
|
|
|
+
|
|
|
+ var customerInfoType = allCustomerInfoType; //售前售后
|
|
|
|
|
|
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();
|
|
@@ -432,21 +439,8 @@ function initProcessResult(type,allCustomerInfoType){
|
|
|
$("#backGoods").hide();
|
|
|
$("#noReasonBack").hide();
|
|
|
$("#customerCostsDiv").hide();
|
|
|
- switch(type)
|
|
|
- {
|
|
|
- case 1:
|
|
|
- otherHied(customerInfoType);
|
|
|
- visitByType(1);
|
|
|
- //getCompany();
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- otherHied(customerInfoType);
|
|
|
- visitByType(2);
|
|
|
- //getCompany();
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
+ $("#sendInformationTitle").hide();
|
|
|
+ otherHied();
|
|
|
}else if(allCustomerInfoType == 2){ //售后
|
|
|
$("#customerCostsDiv").hide();
|
|
|
if(!isInitSendAddressSms){
|
|
@@ -464,206 +458,84 @@ function initProcessResult(type,allCustomerInfoType){
|
|
|
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(); //邮费转账账户
|
|
|
- $("#sendInformationTitle").show();
|
|
|
- $("#sendAddressSmsHtml").show();
|
|
|
- visitByType(2); //需要回访
|
|
|
- //$("#salesChannelsSelect").show(); //展示销售公司
|
|
|
- if(customerInfoType == 1){
|
|
|
- $("#salesChannelsSelect").hide(); //展示销售公司
|
|
|
- $("#TDScollect").hide();
|
|
|
- }else{
|
|
|
- $("#salesChannelsSelect").show(); //展示销售公司
|
|
|
- $("#TDScollect").show();
|
|
|
- }
|
|
|
- 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(); //邮费转账账户
|
|
|
- $("#sendInformationTitle").show();
|
|
|
- $("#sendAddressSmsHtml").show();
|
|
|
- visitByType(2); //需要回访
|
|
|
- //$("#salesChannelsSelect").show(); //展示销售公司
|
|
|
- if(customerInfoType == 1){
|
|
|
- $("#salesChannelsSelect").hide(); //展示销售公司
|
|
|
- $("#TDScollect").hide();
|
|
|
- }else{
|
|
|
- $("#salesChannelsSelect").show(); //展示销售公司
|
|
|
- $("#TDScollect").show();
|
|
|
- }
|
|
|
- $("#customerCostsDiv").show();
|
|
|
- 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(); //邮费转账账户 -- 隐藏
|
|
|
- $("#sendInformationTitle").hide(); //寄回信息标题隐藏
|
|
|
- $("#sendAddressSmsHtml").hide(); //寄回信息标题隐藏
|
|
|
- visitByType(2); //需要回访
|
|
|
- //$("#salesChannelsSelect").show(); //展示销售公司
|
|
|
- if(customerInfoType == 1){
|
|
|
- $("#salesChannelsSelect").hide(); //展示销售公司
|
|
|
- $("#TDScollect").hide();
|
|
|
- }else{
|
|
|
- $("#salesChannelsSelect").show(); //展示销售公司
|
|
|
- $("#TDScollect").show();
|
|
|
- }
|
|
|
- $("#customerCostsDiv").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(); //邮费转账账户
|
|
|
- $("#sendInformationTitle").show();
|
|
|
- $("#sendAddressSmsHtml").show();
|
|
|
- visitByType(2); //需要回访
|
|
|
- //$("#salesChannelsSelect").show(); //展示销售公司
|
|
|
- if(customerInfoType == 1){
|
|
|
- $("#salesChannelsSelect").hide(); //展示销售公司
|
|
|
- $("#TDScollect").hide();
|
|
|
- }else{
|
|
|
- $("#salesChannelsSelect").show(); //展示销售公司
|
|
|
- $("#TDScollect").show();
|
|
|
- }
|
|
|
- $("#customerCostsDiv").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(); //邮费转账账户
|
|
|
- $("#sendInformationTitle").show();
|
|
|
- $("#sendAddressSmsHtml").show();
|
|
|
- visitByType(2); //需要回访
|
|
|
- //$("#salesChannelsSelect").show(); //展示销售公司
|
|
|
- if(customerInfoType == 1){
|
|
|
- $("#salesChannelsSelect").hide(); //展示销售公司
|
|
|
- $("#TDScollect").hide();
|
|
|
- }else{
|
|
|
- $("#salesChannelsSelect").show(); //展示销售公司
|
|
|
- $("#TDScollect").show();
|
|
|
- }
|
|
|
- $("#customerCostsDiv").hide();
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
+ $("#salesChannelsSelect").show(); //展示销售公司
|
|
|
+ $("#TDScollect").show();
|
|
|
+
|
|
|
+ if(procMethodIsBack == 2 && procMethodIsSend == 2){ //不需要寄回,不需要寄出就是 已解决,未解决
|
|
|
+ otherHied();
|
|
|
+ visitByType(1);
|
|
|
}
|
|
|
- }
|
|
|
- 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]);
|
|
|
+ var promType = $("#procTypeId").val() //查看是否为维修
|
|
|
+ if(promType == 3){
|
|
|
+ $("#customerCostsDiv").hide(); //工厂报价
|
|
|
}
|
|
|
- for(var i=0;i<resultProductTableTitle[1].length;i++){
|
|
|
- $("#table2").find("th").eq(i).html(resultProductTableTitle[1][i]);
|
|
|
+
|
|
|
+ if((procMethodIsBack == 1 || procMethodIsSend == 1) && isNeedSelectOrder == 1){ //是否需要寄回 1:需要寄回 2:不需要寄回
|
|
|
+ // result = isSolve.renewed;
|
|
|
+ // resultProductTableTitle = isSolveTitleMsg.renewed;
|
|
|
+ $("#relationProduct").html("产品操作"); //寄回产品
|
|
|
+ $("#processResultStatus").show();
|
|
|
+ $("#orderHead").show();
|
|
|
+ $("#order").show();
|
|
|
+ $("#renewedProduct").show();
|
|
|
+ $("#sendAddressInfo").show();
|
|
|
+ $("#sendAddressByPhone").show();
|
|
|
+ $("#updateProduct").show(); //换新产品
|
|
|
+ $("#postageAccount").show(); //邮费转账账户
|
|
|
+ $("#sendInformationTitle").show();
|
|
|
+ $("#sendAddressSmsHtml").show();
|
|
|
+
|
|
|
+ //地址信息
|
|
|
+ $("#recipientInfoTitle").show();
|
|
|
+ $("#recipientInfo").show();
|
|
|
+ $("#recipientAddress").show();
|
|
|
+ $("#recipientAddressText").show();
|
|
|
+ $("#renewedProduct").show();
|
|
|
+ $("#updateProduct").show();
|
|
|
+ //地址信息
|
|
|
+
|
|
|
+ visitByType(2); //需要回访
|
|
|
+ if(customerInfoType == 1){
|
|
|
+ $("#salesChannelsSelect").hide(); //展示销售公司
|
|
|
+ $("#TDScollect").hide();
|
|
|
+ }else{
|
|
|
+ $("#salesChannelsSelect").show(); //展示销售公司
|
|
|
+ $("#TDScollect").show();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ // 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;
|
|
|
+ // }
|
|
|
|
|
|
- $("#processResultStatus").html(resultHtml);
|
|
|
+ // 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();
|
|
|
+ // opentionSelectOrderDiv();
|
|
|
}
|
|
|
|
|
|
/*已解决|未解决 */
|
|
|
function otherHied(customerInfoType){
|
|
|
- //$("#salesChannelsSelect").show(); //展示销售公司
|
|
|
+ // $("#salesChannelsSelect").show(); //展示销售公司
|
|
|
+ // $("#TDScollect").show();
|
|
|
+ // $("#TDScollectShow").show();
|
|
|
+
|
|
|
$("#processResultStatus").hide(); //处理结果的执行状态 已解决未解决没有该信息
|
|
|
$("#orderHead").hide();
|
|
|
$("#order").hide();
|
|
@@ -672,18 +544,9 @@ function otherHied(customerInfoType){
|
|
|
$("#recipientAddress").hide();
|
|
|
$("#recipientAddressText").hide();
|
|
|
$("#renewedProduct").hide();
|
|
|
- //$("#TDScollect").show();
|
|
|
- //$("#TDScollectShow").show();
|
|
|
$("#sendAddressInfo").hide();
|
|
|
$("#sendAddressByPhone").hide();
|
|
|
$("#updateProduct").hide();
|
|
|
- if(customerInfoType == 1){
|
|
|
- $("#salesChannelsSelect").hide(); //展示销售公司
|
|
|
- $("#TDScollect").hide();
|
|
|
- }else{
|
|
|
- $("#salesChannelsSelect").show(); //展示销售公司
|
|
|
- $("#TDScollect").show();
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
/*初始化问题大类*/
|
|
@@ -1314,106 +1177,6 @@ function linkageSetDistrict(){
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 展示产品 -- 20180417以前
|
|
|
- * @param orderItemList
|
|
|
- */
|
|
|
-/*function setProduce(orderItemList) {
|
|
|
- var productList = getProduct() ; //所有产品
|
|
|
- var html = "";
|
|
|
- var productTypeNo = 0;
|
|
|
-
|
|
|
- for(var i=0;i<productList.length;i++) {
|
|
|
- var product = productList[i];
|
|
|
- var produceFittings = getProduceFittings(product.productId); //获取该产品的所有配件
|
|
|
- var colorList = product.colorList; //该产品的所有颜色
|
|
|
-
|
|
|
- var productType = product.productType;
|
|
|
-
|
|
|
- var colorHtml = '';
|
|
|
- if(colorList != null && colorList.length >0 ){
|
|
|
- colorHtml += '<table style="height: 100%;">';
|
|
|
- for(var j=0;j<colorList.length;j++){
|
|
|
- var number = "";
|
|
|
- var color = colorList[j];
|
|
|
- for(var k=0;k<orderItemList.length;k++){
|
|
|
- var item = orderItemList[k];
|
|
|
- if(item.itemColorId == color.colorId && item.itemIsSource == 1){
|
|
|
- number = item.itemNum;
|
|
|
- }
|
|
|
- }
|
|
|
- var fristInputStyle = "border-top: 1px solid #ddd;";
|
|
|
- if(color.colorProductId == product.productId) {
|
|
|
- colorHtml += '<tr >' +
|
|
|
- ' <td width="55" style="border-left: none;text-align: center;'+ fristInputStyle +'">' + color.colorName + '</td>' +
|
|
|
- ' <td width="45" style="'+ fristInputStyle +' padding: 0px;width: 25px;">' +
|
|
|
- ' <input type="hidden" class="input-produce-id" value="' + color.colorProductId + '">' +
|
|
|
- ' <input type="hidden" class="input-color-id" value="' + color.colorId + '">' +
|
|
|
- ' <input type="text" class="input-text input-color-number number-input" style="width: 100%;border: none;text-align: center;" value="'+ number +'" placeholder="产品数量" id="color-' + color.colorProductId + '-' + color.colorId + '" name="" onkeyup="keyFun($(this),999)" onpaste="keyFun($(this),999)" >' +
|
|
|
- ' </td>' +
|
|
|
- ' </tr>';
|
|
|
- fristInputStyle = "";
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- colorHtml += '</table>';
|
|
|
- }else{
|
|
|
- colorHtml += '<span>暂无该产品的颜色!<span>';
|
|
|
- }
|
|
|
-
|
|
|
- var produceFittingsHtml = '';
|
|
|
- if(produceFittings != null && produceFittings.length > 0){
|
|
|
- produceFittingsHtml += '<table style="height: 100%;">';
|
|
|
- for(var m=0;m<produceFittings.length;m++){
|
|
|
-
|
|
|
- var number = "";
|
|
|
- var fitt = produceFittings[m];
|
|
|
- for(var k=0;k<orderItemList.length;k++){
|
|
|
- var item = orderItemList[k];
|
|
|
- if(item.itemColorId == fitt.fittingsId && item.itemIsSource == 2){
|
|
|
- number = item.itemNum;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- var produceFit = produceFittings[m];
|
|
|
- if(produceFit.productId == product.productId) {
|
|
|
- var fristInputStyle = "border-top: 1px solid #ddd;";
|
|
|
- produceFittingsHtml += '<tr >' +
|
|
|
- ' <td width="55" style="border-left: none;text-align: center; '+ fristInputStyle +'">' + produceFit.fittingsName +'</td>' +
|
|
|
- ' <td width="45" style="'+ fristInputStyle +'padding: 0px;width: 25px;">' +
|
|
|
- ' <input type="hidden" class="input-produce-id" value="' + produceFit.productId + '">' +
|
|
|
- ' <input type="hidden" class="input-fittings-id" value="' + produceFit.fittingsId +'">' +
|
|
|
- ' <input type="text" class="input-text input-fittings-number" style="width: 100%;border: none;text-align: center;" value="'+ number +'" placeholder="配件数量" id="fittings-' + produceFit.productId + '-' + produceFit.fittingsId +'" name="" onkeyup="keyFun($(this),999)" onpaste="keyFun($(this),999)" >' +
|
|
|
- ' </td>' +
|
|
|
- ' </tr>';
|
|
|
- fristInputStyle = "";
|
|
|
- }
|
|
|
- }
|
|
|
- produceFittingsHtml += '</table>';
|
|
|
- }else{
|
|
|
- produceFittingsHtml += '<span>暂无产品配件!<span>';
|
|
|
- }
|
|
|
-
|
|
|
- var produceHtml = '<input type="hidden" value="'+ product.productId +'">' +
|
|
|
- '<span>'+ product.productName +'</span>';
|
|
|
-
|
|
|
- html += ' <tr >' +
|
|
|
- ' <td width="80">'+ produceHtml +'</td>' +
|
|
|
- ' <td style="padding: 0px;text-align: center;">' +
|
|
|
- colorHtml +
|
|
|
- ' </td>' +
|
|
|
- ' <td style="padding: 0px;text-align: center;">' +
|
|
|
- produceFittingsHtml +
|
|
|
- ' </td>' +
|
|
|
- '</tr>';
|
|
|
- }
|
|
|
-
|
|
|
- $("#addProduct").html(html);
|
|
|
-
|
|
|
- setBackProduct(html); //设置寄回产品
|
|
|
- //monitorProduct(); //监听产品变化
|
|
|
-}*/
|
|
|
-
|
|
|
-/**
|
|
|
* 展示产品 -
|
|
|
* todo 20180417
|
|
|
* @param orderItemList
|
|
@@ -1443,7 +1206,7 @@ function setProduce(orderItemList) {
|
|
|
+ '<input type="hidden" class="input-fc-id" value="' + item.itemColorId +'">'
|
|
|
+ '<input type="hidden" class="input-69code" value="' + item.itemColorBar +'">'
|
|
|
+ fiHtml
|
|
|
- + '<input type="'+ fiHidden +'" class="input-text input-number input-code" style="width: 100%;border: none;text-align: center;" value="" placeholder="机器编号" name="" id="item-' + item.itemProductId + '-' + item.itemColorId +'" number="'+ item.itemNum +'" itemIsSource="'+ item.itemIsSource +'" onkeyup="keyFunString($(this),30)" onpaste="keyFunString($(this),30)" >'
|
|
|
+ + '<input type="'+ fiHidden +'" class="input-text input-number input-code" style="width: 100%;border: none;text-align: center;" value="" placeholder="机器编号" name="" id="item-' + item.itemProductId + '-' + item.itemColorId +'" number="'+ item.itemNum +'" " onkeyup="keyFunString($(this),30)" onpaste="keyFunString($(this),30)" >'
|
|
|
+ '</td>'
|
|
|
+ '</tr>';
|
|
|
}
|
|
@@ -1642,17 +1405,20 @@ function opentionSelectOrder(type){
|
|
|
* 展示订单
|
|
|
*/
|
|
|
function opentionSelectOrderDiv(){
|
|
|
- if(isNeedSelectOrder == 2 || allCustomerType == 1 || allCustomerType == 2 ){ //不展示
|
|
|
+ if(isNeedSelectOrder == 2 || (allProcMethodIsBack == 2 && allProcMethodIsSend == 2) ){ //不展示
|
|
|
$("#orderHead").hide();
|
|
|
$("#order").hide();
|
|
|
$("#renewedProduct").hide();
|
|
|
+ $("#updateProduct").hide();
|
|
|
}else{ //展示
|
|
|
$("#orderHead").show();
|
|
|
$("#order").show();
|
|
|
- if(allCustomerType == 3 || allCustomerType == 4 || allCustomerType == 6 || allCustomerType == 7 ){
|
|
|
+ if(allProcMethodIsBack == 1){
|
|
|
$("#renewedProduct").show();
|
|
|
+ $("#updateProduct").show();
|
|
|
}else{
|
|
|
$("#renewedProduct").hide();
|
|
|
+ $("#updateProduct").hide();
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -1698,30 +1464,17 @@ $(function(){
|
|
|
|
|
|
/* 添加客诉的准备 */
|
|
|
function addCustomerReady(){
|
|
|
- //保存QA
|
|
|
- //saveQuestion(2);
|
|
|
-
|
|
|
- var QAId = $("#questionId").val();
|
|
|
- if(QAId == null || QAId == "" || typeof (QAId) == "undefined"){
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
/* 是否需要添加订单,赋值 */
|
|
|
$("#isNeedSelectOrder").val(isNeedSelectOrder);
|
|
|
if(isNeedSelectOrder == 1){
|
|
|
var post_ids = $("#ids").val();
|
|
|
if(post_ids == null || post_ids == ""){
|
|
|
layer.msg("请重新选择订单", {icon: 5, time: 3000});
|
|
|
- phoneFlag = false;
|
|
|
+ return false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /* 录入电话号码和姓名到客诉基本信息里面 */
|
|
|
- /*if(allCustomerType == 3 || allCustomerType == 4 || allCustomerType == 5 || allCustomerType == 6 || allCustomerType == 7){
|
|
|
- $("#customerName").val($("#sendName").val());
|
|
|
- $("#customerTel").val($("#sendTel").val());
|
|
|
- }*/
|
|
|
-
|
|
|
+ /*验证手机号码*/
|
|
|
var phoneFlag = true;
|
|
|
$(".associated-phone").each(function () {
|
|
|
var phone = $(this).val();
|
|
@@ -1730,33 +1483,13 @@ function addCustomerReady(){
|
|
|
vailErrorMsg($(this),"手机号码格式不正确");
|
|
|
phoneFlag = false;
|
|
|
}
|
|
|
- /*if (!phoneReg.test(phone)) {
|
|
|
- vailErrorMsg($(this),"手机号码格式不正确");
|
|
|
- phoneFlag = false;
|
|
|
- }*/
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
if(!phoneFlag){
|
|
|
return false;
|
|
|
}
|
|
|
+ /*验证手机号码*/
|
|
|
|
|
|
- /*验证来源入口*/
|
|
|
- // var customerSourceType = $("input:radio[name='customerSourceType']:checked").val();
|
|
|
- // var ty_text = $(".customerSourceType_text_"+customerSourceType).val();
|
|
|
- // if(ty_text != null && ty_text != "" && typeof(ty_text) != "undefined" ){
|
|
|
- // $("#customerSource").val(ty_text);
|
|
|
- // }
|
|
|
-
|
|
|
- // 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"));
|
|
@@ -1817,165 +1550,31 @@ function addCustomerReady(){
|
|
|
$("#describeHandleDesc").val(describeHandleDescText);
|
|
|
/*----处理描述--end-----*/
|
|
|
|
|
|
- /* --- 类型:售后 处理结果:维修/换新/补发/退货/无理由退货 -- 处理产品 start---- */
|
|
|
-
|
|
|
- if(isNeedSelectOrder == 1) { //需要订单
|
|
|
|
|
|
+ /* --- 类型:售后 处理结果:维修/换新/补发/退货/无理由退货 -- 处理产品 start---- */
|
|
|
+ if(isNeedSelectOrder == 1 && (allProcMethodIsBack == 1 || allProcMethodIsSend == 1 ) ) { //需要订单
|
|
|
var sendProdcues = new Array(); //寄出产品表
|
|
|
- var sendFittings = new Array();
|
|
|
- var closedProdcues = new Array(); //获取寄回,寄出直接复制寄回
|
|
|
- var closedFittings = new Array(); //获取寄回,寄出直接复制寄回
|
|
|
+ var closedProdcues = new Array(); //获取寄回,寄出直接复制寄回
|
|
|
|
|
|
$("#addProduct").find(".input-code").each(function () {
|
|
|
var machineNo = $(this).val(); //机器编号
|
|
|
var number = $(this).parents("tr").find(".input-itemNum").eq(0).val(); //数量
|
|
|
- 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();
|
|
|
product.colorBar = $(this).parent().find(".input-69code").val();
|
|
|
- // fittings.productId = $(this).parent().find(".input-produce-id").val();
|
|
|
- // fittings.fittingsId = $(this).parent().find(".input-fc-id").val();
|
|
|
- fittings.colorBar = $(this).parent().find(".input-69code").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);
|
|
|
- }
|
|
|
+ product.sendProdcueNumber = number;
|
|
|
+ product.closedProdcueNumber = number;
|
|
|
+ product.closedProdcueMachineNo = machineNo;
|
|
|
+ if (allProcMethodIsBack == 1 ){
|
|
|
+ closedProdcues.push(product);
|
|
|
+ }
|
|
|
+ if (allProcMethodIsSend == 1 ){
|
|
|
+ sendProdcues.push(product);
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
- // $("#addProduct").find(".input-fittings-number").each(function () {
|
|
|
- // var number = $(this).val();
|
|
|
- // if (number != null && number != "" && number != 0) {
|
|
|
- // var fittings = new Object();
|
|
|
- // fittings.productId = $(this).parent().find(".input-produce-id").val();
|
|
|
- // fittings.fittingsId = $(this).parent().find(".input-fittings-id").val();
|
|
|
- // //换新、维修,退货,无理由退货,
|
|
|
- // if (allCustomerType == 3 || allCustomerType == 4 || allCustomerType == 6 || allCustomerType == 7) {
|
|
|
- // fittings.closedFittingNumber = number;
|
|
|
- // closedFittings.push(fittings);
|
|
|
- // } else if (allCustomerType == 5) {
|
|
|
- // fittings.sendFittingNumber = number;
|
|
|
- // sendFittings.push(fittings);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // })
|
|
|
-
|
|
|
- // $("#back-product").find(".input-color-number").each(function () {
|
|
|
- // var number = $(this).val();
|
|
|
- // if (number != null && number != "" && number != 0) {
|
|
|
- // //换新、维修,
|
|
|
- // if (allCustomerType == 3 || allCustomerType == 4) {
|
|
|
- // var fittings = new Object();
|
|
|
- // fittings.productId = $(this).parent().find(".input-produce-id").val();
|
|
|
- // fittings.colorId = $(this).parent().find(".input-color-id").val();
|
|
|
- // fittings.sendProdcueNumber = number;
|
|
|
- // sendProdcues.push(fittings);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // })
|
|
|
-
|
|
|
- // $("#back-product").find(".input-fittings-number").each(function () {
|
|
|
- // var number = $(this).val();
|
|
|
- // if (number != null && number != "" && number != 0) {
|
|
|
- // //换新、维修
|
|
|
- // if (allCustomerType == 3 || allCustomerType == 4) {
|
|
|
- // var fittings = new Object();
|
|
|
- // fittings.productId = $(this).parent().find(".input-produce-id").val();
|
|
|
- // fittings.fittingsId = $(this).parent().find(".input-fittings-id").val();
|
|
|
- // fittings.sendFittingNumber = number;
|
|
|
- // 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();
|
|
@@ -1999,44 +1598,6 @@ function addCustomerReady(){
|
|
|
}
|
|
|
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 -- =============================== */
|
|
|
|
|
|
|