|
@@ -145,7 +145,7 @@
|
|
|
</span>
|
|
|
</div>
|
|
|
<div class="formControls col-2 col-sm-2"> <span class="select-box">
|
|
|
- <select name="smallClassId" class="select">
|
|
|
+ <select name="smallClassId" id="smallClassId" class="select">
|
|
|
<#--<option value="0">使用操作制水出水</option>
|
|
|
<option value="1">使用操作制水出水</option>-->
|
|
|
</select>
|
|
@@ -180,10 +180,10 @@
|
|
|
<div class="row cl">
|
|
|
<label class="form-label col-1 col-sm-1"><span class="c-red">*</span>问题内容:</label>
|
|
|
<div class="formControls col-5 col-sm-5">
|
|
|
- <input type="hidden" name="questionId" id="questionId">
|
|
|
+ <input type="hidden" name="questionId" id="questionId" value="">
|
|
|
<script id="describeContentText" type="text/plain" style="width:983px;height:250px;"></script>
|
|
|
</script>
|
|
|
- <input type="hidden" name="describeContent" id="describeContent">
|
|
|
+ <input type="hidden" name="describeContent" id="describeContent" value="">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="row cl">
|
|
@@ -194,6 +194,9 @@
|
|
|
<div class="formControls col-2 col-sm-2" style="width: 10%">
|
|
|
<input type="button" class="btn btn-primary" value="发短信給用户" onclick="sendPhone('p','p-msg');">
|
|
|
</div>
|
|
|
+ <div class="formControls col-2 col-sm-2" style="width: 10%">
|
|
|
+ <input type="button" class="btn btn-primary" value="保存QA" onclick="saveQuestion();">
|
|
|
+ </div>
|
|
|
<div class="formControls col-2 col-sm-2 msg-phone">
|
|
|
<div id="p-msg" style="color: #e00"></div>
|
|
|
</div>
|
|
@@ -403,7 +406,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="row cl" id="updateProduct" style="display: none;">
|
|
|
- <label class="form-label col-1 col-sm-1">更换产品:</label>
|
|
|
+ <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>更换产品:</label>
|
|
|
<div class="formControls col-9 col-sm-9" >
|
|
|
|
|
|
<table class="table table-border table-bg table-bordered">
|
|
@@ -693,6 +696,7 @@
|
|
|
|
|
|
/*全局标识当前状态 type : 1 :已解决 2:未解决 3:换新 4:维修 5:补发 6:退货 7:无理由退货*/
|
|
|
var allCustomerType = 1;
|
|
|
+ var allCustomerTypeName = ["已解决","未解决","换新","维修","补发","退货","无理由退货"];
|
|
|
|
|
|
/* 寄回地址的id */
|
|
|
var complaint_questionId = 5;
|
|
@@ -761,13 +765,8 @@
|
|
|
});
|
|
|
|
|
|
/*监听回访类型选择事件 是否需要回访 1:不需要回访 2:需要回复 */
|
|
|
- $("input[name='customerIsVisit']").change(function (){
|
|
|
- if($(this).val() == 2){
|
|
|
- $("#needToVisit").css("display","block");
|
|
|
- }else{
|
|
|
- $("#needToVisit").css("display","none");
|
|
|
- }
|
|
|
- })
|
|
|
+ initVisitEvent();
|
|
|
+
|
|
|
|
|
|
/*监听回访选择客服的选择事件*/
|
|
|
$(document).on('change', '#visitAdminId', function() {
|
|
@@ -806,6 +805,16 @@
|
|
|
|
|
|
})
|
|
|
|
|
|
+ function initVisitEvent(){
|
|
|
+ $("input[name='customerIsVisit']").change(function (){
|
|
|
+ if($(this).val() == 2){
|
|
|
+ $("#needToVisit").css("display","block");
|
|
|
+ }else{
|
|
|
+ $("#needToVisit").css("display","none");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
/*初始化单选框样式*/
|
|
|
function initCheck(){
|
|
|
$('.skin-minimal input').iCheck({
|
|
@@ -837,6 +846,7 @@
|
|
|
initCheckByNode($("#customer-visit-1"));
|
|
|
$("#needToVisit").css("display","block");
|
|
|
}
|
|
|
+ initVisitEvent();
|
|
|
}
|
|
|
|
|
|
function keyFun(node){
|
|
@@ -1138,15 +1148,16 @@
|
|
|
function initComplaintTypeInfo() {
|
|
|
//默认为售前咨询
|
|
|
var customerCounselTypeOverall = allCustomerInfoType;
|
|
|
- var html = "";
|
|
|
+
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
data: {
|
|
|
complaintConsultingType : customerCounselTypeOverall
|
|
|
},
|
|
|
url: "${path}/admin/complaintQuestion/list_complaintType",
|
|
|
- async: false,
|
|
|
+ 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++){
|
|
@@ -1160,7 +1171,6 @@
|
|
|
html = '';
|
|
|
}
|
|
|
$("[name='complaintId']").html(html);
|
|
|
- initComplaintSmallClassInfo(id)
|
|
|
},
|
|
|
error: function(XmlHttpRequest, textStatus, errorThrown){
|
|
|
}
|
|
@@ -1169,28 +1179,33 @@
|
|
|
|
|
|
/*显示小类*/
|
|
|
function initComplaintSmallClassInfo(complaintId){
|
|
|
- var html = "";
|
|
|
- $.ajax({
|
|
|
- type: "POST",
|
|
|
- data: {
|
|
|
- complaintId : complaintId
|
|
|
- },
|
|
|
- url: "${path}/admin/complaintQuestion/list_complaintSmallClass",
|
|
|
- async: false,
|
|
|
- success: function(data){
|
|
|
- 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>';
|
|
|
+ if(complaintId == null || complaintId == ""){
|
|
|
+ var html = '<option value="">请选择问题小类</option>';
|
|
|
+ $("[name='smallClassId']").html(html);
|
|
|
+ }else{
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ data: {
|
|
|
+ complaintId : complaintId
|
|
|
+ },
|
|
|
+ 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 = '';
|
|
|
}
|
|
|
- }else{
|
|
|
- html = '';
|
|
|
+ $("[name='smallClassId']").html(html);
|
|
|
+ },
|
|
|
+ error: function(XmlHttpRequest, textStatus, errorThrown){
|
|
|
}
|
|
|
- $("[name='smallClassId']").html(html);
|
|
|
- },
|
|
|
- error: function(XmlHttpRequest, textStatus, errorThrown){
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1229,7 +1244,7 @@
|
|
|
var complaintQuestion= data.returnMsg.complaintQuestionInfoList[i];
|
|
|
html += '<li class="ask">'+ complaintQuestion.questionName +'' +
|
|
|
'</li>' +
|
|
|
- '<li class="answer" style="height: 65px;overflow: hidden;">答:<span>'+ complaintQuestion.questionProfile +'</span><input class="quesId" value="'+ complaintQuestion.questionId +'"></li>';
|
|
|
+ '<li class="answer" style="height: 65px;overflow: hidden;">答:<span>'+ complaintQuestion.questionProfile +'</span><input class="quesId" type="hidden" value="'+ complaintQuestion.questionId +'"></li>';
|
|
|
}
|
|
|
}else{
|
|
|
html = '';
|
|
@@ -1264,28 +1279,40 @@
|
|
|
var phone = "";
|
|
|
var questionId = "";
|
|
|
var describeTitle = "";
|
|
|
+ var smallClassId = ""; /* 客诉问题类型小类id */
|
|
|
var typeCompany = parseInt($("input:radio[name='typeId']:checked").attr("typeCompany"));
|
|
|
if(type == "p"){
|
|
|
phone = $("#p-phone").val();
|
|
|
questionId = $("#questionId").val();
|
|
|
describeTitle = $("#describeTitle").val();
|
|
|
desc = UE.getEditor('describeContentText').getContent();
|
|
|
+ smallClassId = $("#smallClassId").val();
|
|
|
+ if(smallClassId == null || smallClassId == "" ){
|
|
|
+ layer.close(index);
|
|
|
+ layer.msg("请选择问题分类", {icon: 5, time: 3000});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(desc == null || desc == "" || describeTitle==null || describeTitle == ""){
|
|
|
+ layer.close(index);
|
|
|
+ layer.msg("信息不全,无法发送短信", {icon: 5, time: 3000});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}else if(type == "m"){
|
|
|
phone = $("#m-phone").val();
|
|
|
questionId = complaint_questionId;
|
|
|
desc = UE.getEditor('sendAddressSms').getContent();
|
|
|
+
|
|
|
+ if(desc == null || desc == "" || questionId==null || questionId == ""){
|
|
|
+ layer.close(index);
|
|
|
+ layer.msg("信息不全,无法发送短信", {icon: 5, time: 3000});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}else{
|
|
|
layer.close(index);
|
|
|
layer.msg("发送报错", {icon: 5, time: 3000});
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- if(desc == null || desc == "" || questionId==null || questionId == ""){
|
|
|
- layer.close(index);
|
|
|
- layer.msg("信息不全,无法发送短信", {icon: 5, time: 3000});
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
var reg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
|
|
|
if(!reg.test(phone)){
|
|
|
layer.close(index);
|
|
@@ -1300,6 +1327,7 @@
|
|
|
typeCompany : typeCompany,
|
|
|
phone : phone,
|
|
|
questionId : questionId,
|
|
|
+ smallClassId : smallClassId,
|
|
|
questionName : describeTitle,
|
|
|
questionProfile : desc //回复内容
|
|
|
},
|
|
@@ -1313,7 +1341,71 @@
|
|
|
$("#m-msg").html(data.resultMsg);
|
|
|
}
|
|
|
}else{
|
|
|
+ if(type == "p"){
|
|
|
+ $("#p-msg").html(data.resultMsg);
|
|
|
+ }else if(type == "m"){
|
|
|
+ $("#m-msg").html(data.resultMsg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ layer.close(index);
|
|
|
+ },
|
|
|
+ error: function(XmlHttpRequest, textStatus, errorThrown){
|
|
|
+ if(type == "p"){
|
|
|
+ $("#p-msg").html("发送短信失败");
|
|
|
+ }else if(type == "m"){
|
|
|
+ $("#m-msg").html("发送短信失败");
|
|
|
+ }
|
|
|
+ layer.close(index);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
+ /*保存QA问题*/
|
|
|
+ function saveQuestion(){
|
|
|
+ var index = layer.load(1, {
|
|
|
+ shade: [0.5,'#fff'] //0.1透明度的白色背景
|
|
|
+ });
|
|
|
+ var desc = "";
|
|
|
+ var questionId = "";
|
|
|
+ var describeTitle = "";
|
|
|
+ var smallClassId = ""; /* 客诉问题类型小类id */
|
|
|
+
|
|
|
+ questionId = $("#questionId").val();
|
|
|
+ describeTitle = $("#describeTitle").val();
|
|
|
+ desc = UE.getEditor('describeContentText').getContent();
|
|
|
+ smallClassId = $("#smallClassId").val();
|
|
|
+ if((smallClassId == null || smallClassId == "") && (questionId == null || questionId == "") ){
|
|
|
+ layer.close(index);
|
|
|
+ layer.msg("请选择问题分类", {icon: 5, time: 3000});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(describeTitle==null || describeTitle == ""){
|
|
|
+ layer.close(index);
|
|
|
+ layer.msg("请填写问题标题", {icon: 5, time: 3000});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(desc == null || desc == ""){
|
|
|
+ layer.close(index);
|
|
|
+ layer.msg("请填写问题内容", {icon: 5, time: 3000});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ data: {
|
|
|
+ questionId : questionId,
|
|
|
+ smallClassId : smallClassId,
|
|
|
+ questionName : describeTitle,
|
|
|
+ questionProfile : desc //回复内容
|
|
|
+ },
|
|
|
+ url: "${path}/admin/complaintQuestion/save_question",
|
|
|
+ async: true,
|
|
|
+ success: function(data){
|
|
|
+ if (data.returnCode == 200) {
|
|
|
+ $("#questionId").val(data.returnMsg.questionId);
|
|
|
+ layer.msg(data.resultMsg, {icon: 1, time: 3000});
|
|
|
+ }else{
|
|
|
+ layer.msg(data.resultMsg, {icon: 5, time: 3000});
|
|
|
}
|
|
|
layer.close(index);
|
|
|
},
|
|
@@ -1902,6 +1994,56 @@
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+ var process = true;
|
|
|
+ switch (allCustomerType){
|
|
|
+ case 3:
|
|
|
+ process = processIsEmpty([closedProdcues,closedFittings]);
|
|
|
+ if(!process){
|
|
|
+ layer.msg("必须选择一个换新寄回的产品或配件并填写数量!", {icon: 5, time: 3000});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ process = processIsEmpty([sendProdcues,sendFittings]);
|
|
|
+ if(!process){
|
|
|
+ layer.msg("必须选择一个换新寄送的产品或配件并填写数量!", {icon: 5, time: 3000});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ process = processIsEmpty([closedProdcues,closedFittings]);
|
|
|
+ if(!process){
|
|
|
+ layer.msg("必须选择一个维修寄回的产品或配件并填写数量!", {icon: 5, time: 3000});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ process = processIsEmpty([sendProdcues,sendFittings]);
|
|
|
+ if(!process){
|
|
|
+ layer.msg("必须选择一个维修寄送的产品或配件并填写数量!", {icon: 5, time: 3000});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ process = processIsEmpty([sendProdcues,sendFittings]);
|
|
|
+ if(!process){
|
|
|
+ layer.msg("必须选择一个补发寄送的产品或配件并填写数量!", {icon: 5, time: 3000});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ process = processIsEmpty([closedProdcues,closedFittings]);
|
|
|
+ if(!process){
|
|
|
+ layer.msg("必须选择一个退货寄回的产品或配件并填写数量!", {icon: 5, time: 3000});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 7:
|
|
|
+ process = processIsEmpty([closedProdcues,closedFittings]);
|
|
|
+ if(!process){
|
|
|
+ layer.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));
|
|
@@ -1910,6 +2052,22 @@
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ /* 判断产品与配件是否填入值 */
|
|
|
+ function processIsEmpty(process){
|
|
|
+ if(process != null && process != "" && process.length > 0){
|
|
|
+ var flag = 2;
|
|
|
+ if(process[0] == null || process[0].length < 1 ){
|
|
|
+ flag -- ;
|
|
|
+ }
|
|
|
+ if(process[1] == null || process[1].length < 1 ){
|
|
|
+ flag -- ;
|
|
|
+ }
|
|
|
+ if(flag == 0){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
<!--/请在上方写此页面业务相关的脚本-->
|