CaseDetail
var case_id = 'c6de5389-2ca4-4418-9636-9ef4f5ba9b5a';
var currentUrl = "/Case/CaseDetail?caseid=c6de5389-2ca4-4418-9636-9ef4f5ba9b5a";
var new_caseBase;//
var case_context;
var FullName = '闫宁'
$(function () {
/******************** detail information data load ********************/
var jsOnStr= $("#caseDetail").val();
new_caseBase = jQuery.parseJSON(jsonStr);
$('#id_factorysendtime1').val(new_caseBase.new_factorytime);
//remark by sll 20190328
if (!!new_caseBase.new_barcode) {
try {
$.ajax({
url: '/ESBSerialNo/QueryESBSerilNoInfoBySerialNo',
data: { 'serialNo': new_caseBase.new_barcode },
type: "POST",
cache: false,
success: function (res) {
if (res == null || res == "" || res == "null") {
return;
}
//将null全部替换为“”
var reg = new RegExp("null", "g");
var index = res.indexOf("contractList");
var resFirst = res.substring(0, index);
var resSec = res.substring(index, res.length);
resFirst = resFirst.replace(reg, "\"\"");
res = resFirst + resSec;
var data = jQuery.parseJSON(res);
var DFX = false;
var timeOFF = !!data.FACTORY_SEND_DATE ? ((new Date().getTime() - new Date(data.FACTORY_SEND_DATE).getTime()) / (1000 * 60 * 60 * 24)) : 0;
var Differ = 9 * 30;//九个月默认270天
if (data.Contract_No.length > 2) {
var d = data.Contract_No.substr(data.Contract_No.length - 3, 1);
DFX = !!(d == 'D' || d == 'F' || d == 'X');
}
if ((data.DistributiOnType== '100000000' || data.DistributiOnType== '100000001' || DFX) && !!new_caseBase.isHardware && (Differ >= timeOFF && timeOFF > 0)) {
//新品维保
$('#id_newmatennance').show();
} else {
$('#id_newmatennance').hide();
}
},
error: function (error) {
}
})
} catch (e) {
}
}
case_cOntext= {
caseID: case_id,
data: new_caseBase,
setValue: function (f, value) {
case_context.data[f] = value;
case_context.setControl(f, value);
},
setControl: function (f, value) {
var field = $(".case .info").find("#" + f);
if (field == null)
return;
var val = value;
var txt = val;
if (val == null || $.trim(val) == "null")
txt = "--";
var type = field.attr("fieldtype");
if (type && $.trim(type) != "") {
var ref = field.attr("ref");
switch (type) {
case "bool":
txt = (val ? "是" : "否");
break;
case "reference":
txt = refSelected(ref, val);
break;
case "lookup":
val = (val ? val : { id: "", name: "" });
txt = (val.name == "" ? "--" : val.name);
break;
case "textarea":
//txt = "" + txt + "";
break;
case "datetime":
if (/\/Date\((\d+)\)\//i.test(val)) {
var date = eval(val.replace(/\/Date\((\d+)\)\//i, "new Date($1)"));
txt = date.pattern("yyyy-MM-dd HH:mm");
}
break;
}
}
if (type == "textarea") {
field.html("");
field.find("pre").text(txt);//避免‘<>’字符被html替换内容
} else {
field.html(txt);
//以防保存时丢失
if (type == "lookup") {
field.attr("guid", val.id);
}
if (type == "reference") {
field.attr("guid", val);
}
if (field.attr("id") == "new_serviceid") { field.attr("guid", val); }
if (field.attr("id") == "new_agencyname") {
var new_agencyid = case_context.data["new_agency"];
field.attr("guid", new_agencyid);
}
//REMARK BY SLL 价值客户信息加粗
if (field.attr("id") == "new_valuedcustomertype") {
var new_valuedcustomertypeid = case_context.data["new_valuedcustomertype"];
if (!!new_valuedcustomertypeid) {
field.css({
'color': 'red',
'font-weight': 'bold'
});
}
}
}
},
init: function () {
for (var fieldname in case_context.data) {
case_context.setControl(fieldname, case_context.data[fieldname]);
}
$("#aphone0").click(function () { CallPhoneSpan(this); });
}
};
case_context.init();
$('#new_processer1').val(new_caseBase.new_processer1.name);
$('#new_processer1').attr("guid", new_caseBase.new_processer1.id);
$('#new_responsible').val(new_caseBase.new_responsible.name);
$('#new_responsible').attr("guid", new_caseBase.new_responsible.id);
var hf_new_phOnenumber= ""; //只显示手机号,无匹配时显示new_phonenumber
if (new_caseBase.new_callincustomertype != null && new_caseBase.new_callincustomertype == "100000006") //办事处,回访最终客户联系人
{
if (new_caseBase.new_finalcustomer != null) $('#hf_new_callincustomer').text(new_caseBase.new_finalcustomer.name); //单位名称
if (new_caseBase.new_finalcontact != null) {
$('#hf_new_callincontact').text(new_caseBase.new_finalcontact.name); //联系人
}
if (new_caseBase.new_sendmessage_phone && new_caseBase.new_sendmessage_phone.length == 11 && new_caseBase.new_sendmessage_phone.substring(0, 1) == "1") {
hf_new_phOnenumber= new_caseBase.new_sendmessage_phone;
}
else if (new_caseBase.new_finalcontactphone != "") {
hf_new_phOnenumber= new_caseBase.new_finalcontactphone;
}
}
else {
//单独加载
$('#hf_new_callincustomer').text(new_caseBase.new_callincustomer.name); //单位名称
$('#hf_new_callincontact').text(new_caseBase.new_callincontact.name); //联系人
if (new_caseBase.new_sendmessage_phone && new_caseBase.new_sendmessage_phone.length == 11 && new_caseBase.new_sendmessage_phone.substring(0, 1) == "1") {
hf_new_phOnenumber= new_caseBase.new_sendmessage_phone;
} else if (new_caseBase.new_telephone1 && new_caseBase.new_telephone1.length == 11 && new_caseBase.new_telephone1.substring(0, 1) == "1") {
hf_new_phOnenumber= new_caseBase.new_telephone1;
} else if (new_caseBase.new_telephone2 && new_caseBase.new_telephone2.length == 11 && new_caseBase.new_telephone2.substring(0, 1) == "1") {
hf_new_phOnenumber= new_caseBase.new_telephone2;
} else if (new_caseBase.new_telephone3 && new_caseBase.new_telephone3.length == 11 && new_caseBase.new_telephone3.substring(0, 1) == "1") {
hf_new_phOnenumber= new_caseBase.new_telephone3;
} else if (new_caseBase.new_telephone4 && new_caseBase.new_telephone4.length == 11 && new_caseBase.new_telephone4.substring(0, 1) == "1") {
hf_new_phOnenumber= new_caseBase.new_telephone4;
} else if (new_caseBase.new_telephone5 && new_caseBase.new_telephone5.length == 11 && new_caseBase.new_telephone5.substring(0, 1) == "1") {
hf_new_phOnenumber= new_caseBase.new_telephone5;
} else if (new_caseBase.new_telephone6 && new_caseBase.new_telephone6.length == 11 && new_caseBase.new_telephone6.substring(0, 1) == "1") {
hf_new_phOnenumber= new_caseBase.new_telephone6;
} else {
hf_new_phOnenumber= new_caseBase.new_phonenumber;
}
}
$("#new_distribution_type").attr("key", new_caseBase.new_distribution_type == null ? "" : new_caseBase.new_distribution_type);
//L1L2处理人,移交责任人
//当前用户==L1L2处理人,且责任人与L1L2处理人不相同时,显示
var $aTransResp = $("#aTransResp");
if ((new_caseBase.new_processer_service != null && new_caseBase.new_processer_service.id == '2787a769-c5db-e711-b809-00155d157c0a')
&& new_caseBase.new_processer_service.id != new_caseBase.new_responsible.id) {
$aTransResp.show().click(function () {
confirm("确认移交L1L2处理人给当前责任人(" + new_caseBase.new_responsible.name + ")?", function () {
$.ajax({
url: '/Case/TransCaseResp',
data: { caseId: case_id },
type: "POST",
dataType: 'json',
success: function (data) {
if (data.status == 0) {
$("#new_processer_service").text($("#new_responsible").text())
$aTransResp.hide();
}
if (data.message) {
alert(data.message);
}
}
});
});
});
} else {
$aTransResp.hide();
}
$('#hf_new_phonenumber').text(hf_new_phonenumber); //来电号码
var score = "";
if (new_caseBase.new_visitscore != null) {
score = new_caseBase.new_visitscore;
switch (score) {
case 1: score = 100; break;
case 2: score = 80; break;
case 3: score = 60; break;
case 4: score = 40; break;
case 5: score = 20; break;
}
}
$('#hf_new_visitscore').text(score); //短信评分
/******************** detail information data load end ********************/
/********************change the status as editable ********************/
var changeForUpdate = function (btn, callback) {
$("#aphone0").unbind("click");
var trg = $(btn).attr("target");
var tab = $(trg);
var new_casestauts = case_context.data['new_casestauts'];
var new_casetype = case_context.data['new_casetype'];
var new_caselevel = case_context.data['new_caselevel'];
tab.find("span[fieldtype]").each(function () {
if ($(this).hasClass("readonly")) {
return;
}
var fieldtype = $(this).attr("fieldtype");
var fieldname = $(this).attr("id");
var val = case_context.data[fieldname];
var required = $(this).attr("required");
$(this).text("");
var editer;
switch (fieldtype) {
case "text":
var fieldlength = "";
if ($(this).attr("length") != null) {
fieldlength = " maxlength='" + $(this).attr("length") + "'";
}
var style = "";
if (fieldname == "new_title" || fieldname == "new_businessFeedback") { style = " " }
editer = $("");
editer.val(val);
if ($(this).attr('islookup') == 'true') {
editer = $("");
editer.val(val);
lookupInit(editer);
}
break;
case "datetime":
editer = $("");
editer.val(val);
break;
case "textarea":
editer = $("");
editer.val(val);
break;
case "bool":
editer = $("");
editer.attr("checked", Boolean((val == "false") ? false : val));
editer.click(function () {
//this.checked = !this.checked;
});
break;
case "lookup":
var reference = $(this).attr("reference");
var reffieldname = $(this).attr("fieldname");
val = (val ? val : { id: "", name: "" });
if (reference && reference.length > 0 && reffieldname && reffieldname.length > 0) {
editer = $("");
} else {
editer = $("");
}
editer.val(val.name);
editer.attr("guid", val.id);
lookupInit(editer);
//editer.click(function () {
// openLookup(this);
//});
break;
case "reference":
editer = $("");
//REMARK BY SLL 2019/06/22 已有解决方案的问题单无法修改问题类型、问题级别
if (fieldname == "new_casetype" || fieldname == "new_caselevel") {
if (new_casestauts >= 100000007 && new_casestauts != 100000015) {
editer = $("");
//var imgDom = '';
var imgDom = '';
$(this).append(imgDom);
var $Doma = $($(this).find('a'));
$Doma.attr('data-tooltip', '已有解决方案无法修改问题级别');
if (fieldname == "new_casetype") {
$Doma.attr('data-tooltip', '已有解决方案无法修改问题类型');
}
$Doma.darkTooltip({
animation: 'flipIn',
gravity: 'south',
theme: 'light'
});
}
}
setSelected($(this).attr("ref"), editer);
editer.val(val);
if (fieldname == "new_casetype") {
editer.change(function () {
var selectedVal = $(this).val();
if (new_casetype == '100000002' && selectedVal != '100000002') {
alert('无法将问题单由故障类型更改为其他类型');
$(this).val(new_casetype);
return false;
}
if (selectedVal == "100000002") {
$("#new_caselevel select").val("100000002");
var $html = '';
$('#td_devicestage').append($html);
}
else {
$("#new_caselevel select").val("100000003");
$('#td_devicestage>label').remove();
}
});
}
if (fieldname == "new_caselevel") {
editer.change(function () {
var selectedVal = $(this).val();
var selectedCaseTypeValue = $("#new_casetype select").val();
if (new_caselevel >= '100000000' && new_caselevel <= '100000002' && selectedVal == '100000003') {
alert('无法将问题级别由故障级别更改为咨询级别');
$(this).val(new_caselevel);
return false;
}
if (selectedVal == "100000000" || selectedVal == "100000001" || selectedVal == "100000002") {
$("#new_casetype select").val("100000002");
} else if (selectedCaseTypeValue == "100000002") {
$("#new_casetype select").val("100000000");
}
});
}
break;
case "new_barcode":
editer = $("");
editer.val(val);
break;
}
editer.appendTo(this);
});
callback(btn);
};
/********************change the status as display ********************/
var changeForDisplay = function (btn, saved) {
$("#aphone0").click(function () { CallPhoneSpan(this); });
var trg = $(btn).attr("target");
var tab = $(trg);
tab.find("span[fieldtype]").each(function () {
if ($(this).hasClass("readonly")) {
return;
}
var fieldtype = $(this).attr("fieldtype");
var fieldname = $(this).attr("id");
var editer = $(this).find("*[name]:first");
var val;
switch (fieldtype) {
case "bool":
if (saved) {
val = editer.get(0).checked;
case_context.data[fieldname] = val;
}
else {
val = case_context.data[fieldname];
val = Boolean((val == "false") ? false : val);
}
$(this).html(val ? "是" : "否");
break;
case "lookup":
if (saved) {
val = { id: editer.attr("guid"), name: editer.val() };
case_context.data[fieldname] = val;
$(this).html(val.name);
}
else {
val = case_context.data[fieldname];
$(this).html((val && val.name) ? val.name : "--");
}
break;
case "reference":
if (saved) {
val = editer.val();
case_context.data[fieldname] = val;
}
else {
val = case_context.data[fieldname];
}
$(this).html(refSelected($(this).attr("ref"), val));
break;
case "textarea":
if (saved) {
val = editer.val();
case_context.data[fieldname] = val;
}
else {
val = case_context.data[fieldname];
}
if (val == null || $.trim(val) == "")
val = "--";
$(this).html("");
$(this).find("pre").text(val);//避免‘<>’字符被html替换内容
break;
case "datetime":
if (saved) {
val = editer.val();
case_context.data[fieldname] = val;
}
else {
val = case_context.data[fieldname];
}
if (val == null || $.trim(val) == "")
val = "--";
$(this).html(val);
break;
default:
if (saved) {
val = editer.val();
case_context.data[fieldname] = val;
}
else {
val = case_context.data[fieldname];
}
if (val == null || $.trim(val) == "")
val = "--";
$(this).html(val);
break;
}
$(editer).remove();
});
};
/******************** commit the all value to server ********************/
var updateForRefrush = function (btn, callback) {
var trg = $(btn).attr("target");
var tab = $(trg);
var parameters = {
'submitstatus': submitstatus,
'new_callincustomer': tab.find("*[name='new_callincustomer']").attr("guid"),//'F298D183-9595-4C57-94BB-0004CB16C2A9',
'new_callincustomertype': tab.find("*[name='new_callincustomertype']").val(),//'100000003',
'new_callincontact': tab.find("*[name='new_callincontact']").attr("guid"),//'1C4BEDDF-5A53-4676-9DA3-000119C69569',
'new_agentcode': tab.find("*[name='new_agentcode']").val(),//代理商编码 '3456',
'new_phonenumber': tab.find("*[name='new_phonenumber']").val(), //联系人电话
'EMailAddress1': tab.find("*[name='EMailAddress1']").val(), //联系人邮箱
'new_natural': tab.find("*[name='new_natural']").val(),//'100000003', ????????
'new_barcode': tab.find("*[name='new_barcode']").val(),//'210231A563N127007483',
'new_productid': tab.find("*[name='new_productid']").attr("guid"),//'3223C2F7-450E-E411-BBC1-0CDA411D94B9',
//'new_FreeServiceDesc': tab.find("*[name='new_FreeServiceDesc']").val(),//维保状态 '基本维保5x10xNBD发出',
//'new_projectname': tab.find("*[name='new_projectname']").val(),//项目名称 '华三呼叫中心',
'new_productline': tab.find("*[name='new_productline']").attr("guid"),//'6ACE0837-CF07-E411-BBC1-0CDA411D94B9',
'new_productserie': tab.find("*[name='new_productserie']").attr("guid"),//'E23FA3DC-FA0A-E411-BBC1-0CDA411D94B9',
'new_productversion': tab.find("*[name='new_productversion']").attr("guid"),//'1BE04EFD-3FE6-E311-A045-0CDA411D94B9',
'new_productgroup': tab.find("*[name='new_productgroup']").attr("guid"),//'1BE04EFD-3FE6-E311-A045-0CDA411D94B9',
'new_casesource': tab.find("*[name='new_casesource']").val(),//'100000003',
'new_title': tab.find("*[name='new_title']").val(),//'PD002_自助工单',
'new_usercategory': tab.find("*[name='new_usercategory']").val(),//'100000002',
'new_processer1': case_context.data.new_processer1.id,// 'CAD578B3-56A5-4A96-A818-067950146892',
//'new_finalcustomer': tab.find("*[name='new_finalcustomer']").attr("guid"),// 最终客户名称 'B951E94D-18FB-45E4-91B1-0005D1425552',
//'new_finalcustomertype': tab.find("*[name='new_finalcustomertype']").val(),//最终客户类型 '100000003',
//'new_ServiceLevelNew': tab.find("*[name='new_ServiceLevelNew']").val(),//服务级别 '运营商高级维保7x24xNBD发出',
//'new_valuedcustomertype': tab.find("*[id='new_valuedcustomertype']").val(),//'true',
//'new_isofficevalued': tab.find("*[name='new_isofficevalued']").val(),//办事处重要客户 'true',
//'new_customertypesub': tab.find("*[name='new_customertypesub']").val(),//客户类型细分 '100000012',
//'new_h3carelevel': tab.find("*[name='new_h3carelevel']").val(),//H3Care会员级别 '100000004',
//'new_h3careno': tab.find("*[name='new_h3careno']").val(), //H3Care会员卡号 '345677',
//'new_InsideNew': tab.find("*[name='new_InsideNew']").val(),//Inside总代 '100000000',
//'new_ServiceLevelNew': tab.find("*[name='new_ServiceLevelNew']").val(),//'100000000',
//'new_contractnumber': tab.find("*[name='new_contractnumber']").val(),//服务合同号 'A1120110113A',
//'new_servcontractname': tab.find("*[name='new_servcontractname']").val(),//服务合同名称 'h3c呼叫中心支持',
//'new_serviceid': tab.find("*[name='new_serviceid']").val(),//服务ID
'new_valuedcustomertype': tab.find("*[id='new_valuedcustomertype']").attr("guid"),//'true',
'new_casedescription': tab.find("*[name='new_casedescription']").val(),//'1、编号、创建者、责任人、处理人能不能隐藏? 2、选择提单客户后会关联出联系人,选择联系人后再修改提单客户联系人和联系电话应该清空 3、选择产品时也会报异常,版本输入后有异常'
//'workItemStatus': new_caseBase.new_casestauts,
'new_casetype': tab.find("*[name='new_casetype']").val(),
'new_caselevel': tab.find("*[name='new_caselevel']").val(),
'new_ProductDescription': tab.find("*[name='new_ProductDescription']").val(),
'new_responsible': case_context.data.new_responsible.id,// tab.find("*[name='new_responsible']").val(),
'new_casestauts': new_caseBase.new_casestauts,
'new_is_soho': tab.find("*[name='new_is_soho']").prop("checked"),
'new_distribution_type': tab.find("*[id='new_distribution_type']").attr("key"),
//最终客户信息
'new_FreeServiceDesc': tab.find("[id='new_FreeServiceDesc']").text(),//维保状态
'new_warranty_status': tab.find("[id='new_warranty_status']").text(),//维保状态选项值
'new_projectname': tab.find("[id='new_projectname']").text(),//项目名称
'new_InsideNew': tab.find("[id='new_InsideNew']").attr("guid"),//Inside总代 new_InsideNew
'new_finalcustomer': tab.find("[id='new_finalcustomer']").attr("guid"), //最终客户名称 finalcustomer
'new_finalcustomertype': tab.find("[id='new_finalcustomertype']").attr("guid"), //最终客户类型 new_finalcustomertype
'new_servcontractname': tab.find("[id='new_servcontractname']").text(), //服务合同名称 new_servcontractname
'new_contractnumber': tab.find("[id='new_contractnumber']").text(), //服务合同号 new_contractnumber
'new_support_branch': tab.find("[id='new_support_branch']").text(),//合同所属部门
'new_support_branch_number': tab.find("[id='new_support_branch_number']").text(),//合同所属部门编码
'new_customertypesub': tab.find("[id='new_customertypesub']").attr("guid"),//客户类型细分 new_customertypesub
'new_isofficevalued': tab.find("[id='new_isofficevalued']").text() == '是' ? "true" : "false",//办事处重要客户 new_isofficevalued
'new_serviceid': tab.find("[id='new_serviceid']").attr("guid"),//服务ID new_serviceid
'new_ServiceLevelNew': tab.find("[id='new_ServiceLevelNew']").text(), //服务级别 new_ServiceLevelNew
'new_h3carelevel': tab.find("[id='new_h3carelevel']").attr("guid"),//H3Care会员级别 new_h3carelevel
'new_h3careno': tab.find("[id='new_h3careno']").text(),//H3Care会员卡号 new_h3careno
'new_agency': tab.find("[id='new_agencyname']").attr("guid"), //所属办事处
'new_finalcustomername1': tab.find("*[name='new_finalcustomername1']").val(), //真实客户
'new_secondagent': tab.find("[id='new_secondagent']").text(),//二级代理商
'new_servicequai': tab.find("[id='new_servicequai']").text(),//代理商服务资质
'new_InsideAgentName': tab.find("[id='new_InsideAgentName']").text(),//inside总代
'new_cndtServiceStartDate': tab.find("[id='new_cndtServiceStartDate']").text(),//服务开始时间
'new_cndtServiceEndDate': tab.find("[id='new_cndtServiceEndDate']").text(),//服务结束时间
'new_cndtLatestDate': tab.find("[id='new_cndtLatestDate']").text(),//最迟维保截至日期总代
'new_firstordernum': tab.find("[id='new_firstordernum']").text(),//一级订单号
'new_account_service_type': tab.find("[id='new_account_service_type']").text(),//客户服务级别
'new_devicestage': tab.find("*[name='new_devicestage']").val(),//'100000003',,//设备应用阶段
'new_factorysendtime': $('#id_factorysendtime1').val(),//厂商发货时间
'new_productnamess': $('#new_productname').text(),//条码对应产品
'new_barcodechangereason': $('[name="new_barcodechangereason"]').val(),//条码更改原因
'new_businessFeedback': $('[name="new_businessFeedback"]').val(),//保外商机反馈
'new_countrysource': $('[name="new_countrysource"]').val(),
'new_productgroupsolution': $('[name="new_productgroupsolution"]').val()//解决方案名称
};
$.ajax({
url: '/Case/UpdateCase?new_caseId=' + case_id,
data: parameters,
type: "POST",
dataType: 'json',
cache: false,
async: true,
beforeSend: function () {
loading();
},
success: function (data) {
if (data.message) {
alert(data.message);
}
if (data.status != 0) {
return;
}
callback(btn, true);
$(btn).attr("updating", "false");
$(btn).text("编辑");
$($(btn).attr("cancelbtn")).hide();
$("#btn_submit").hide();
$("#btn_submit").attr("updating", false);
window.location.href = currentUrl + "¤tTab=" + $("#currentTab").val();
},
complete: function (xhr) {
unloading();
}
});
};
var submitstatus = false;
/******************** init the event for operation button ********************/
$("#btn_editbasic").click(function () {
var updating = $(this).attr("updating");
$(".reqSpan").show();
debugger;
if (updating && updating == "true") {
//判断
if ($("select[name='new_casetype']").val().length == 0) {
alert("请选择问题类型!");
} else if ($("select[name='new_caselevel']").val().length == 0) {
alert("请选择问题级别!");
//} else if ($("input[name='new_productversion']").val().length == 0) {
// alert("请选择产品版本!");
} else if ($("textarea[name='new_casedescription']").val().length > 2000) {
alert("问题描述长度超过2000!");
} else if ($("textarea[name='new_ProductDescription']").val().length > 2000) {
alert("产品描述长度超过2000!");
} else if ($("select[name='new_casetype']").val() == '100000002' && $("select[name='new_devicestage']").val().length == 0) {
alert("设备应用阶段不能为空");
} else if (!$('#id_tr_barcodechangereason').is(':hidden') && !$('[name="new_barcodechangereason"]').val()) {
alert("新条码产品线与原产品线不一致,请填写更换条码原因");
}
else {
updateForRefrush(this, changeForDisplay);
}
}
else if (updating == "false") {
$('#id_tr_barcodechangereason').hide();
changeForUpdate(this, function (e) {
$(e).attr("updating", "true");
$(e).text("保存");
$("#btn_submit").attr("updating", "true");
$("#btn_submit").show();
$("#btn_cancelbasic").show();
});
}
});
$("#btn_submit").click(function () {
submitstatus = true;
case_context.setValue("new_casestauts", 100000000);
$("#btn_editbasic").click();
});
$("#btn_cancelbasic").click(function () {
confirm("取消编辑?", function () {
var new_barcode = case_context.data["new_barcode"];// $("#").text();
$("input[name='new_barcode']").val(new_barcode).trigger("change"); //刷新条形码
var $btn_cancelbasic = $("#btn_cancelbasic")
var btn_edit = $(".btn_edit[updating='true'][cancelbtn='#" + $btn_cancelbasic.attr("id") + "']");
changeForDisplay(btn_edit, false);
btn_edit.attr("updating", false);
$("#btn_submit").attr("updating", false);
btn_edit.text("编辑");
$btn_cancelbasic.hide();
$("#btn_submit").hide();
$(".reqSpan").hide(); //隐藏*
});
});
/******************** init the event for operation button end ********************/
/********* loading 工单处理过程 start *********/
var loadDealprodure = function () {
listDataLoad({
parameters: requestParam, url: "/Case/GetDealprodureList", obj: "tb_DealprodureList"
});
};
var loadRmaList = function () {
listDataLoad({
parameters: requestParam, url: "/Case/GetRmaList", obj: "tb_RmaList", operating: { "查看": viewRma }
});
};
/********* loading 工单处理过程 end *********/
var requestParam = { new_case: case_id };
/********* loading progress *********/
$("#btnAddprogress").click(function () {
openModelDialog("添加处理进展", "/Case/CreateProgressPage?new_case=" + new_caseBase.new_caseId + "&status=2", 500, 500);
});
var updateProgress = function (data) {
openModelDialog("更新处理进展", "/Case/CreateProgressPage?new_case=" + new_caseBase.new_caseId + "&status=3&new_progress查看处理进展", "/Case/CreateProgressPage?new_case=" + new_caseBase.new_caseId + "&status=4&new_progress/Case/GetProgressList", obj: "tb_ProgressList", operating: { "编辑": updateProgress, "查看": viewProgress } });
};
/********* loading progress end *********/
/********* loading Solution *********/
$("#btnAddSolution").click(function () {
if (!$('#new_casetype').text() || !$('#new_caselevel').text() || $('#new_casetype').text() == '--' || $('#new_caselevel').text() == '--') {
alert("请先填写问题单的问题级别以及问题类型信息");
return false;
}
//2019-04-26 SLL
var versiOnID= $('#new_productversion').attr('guid');
var caselevel = $('#new_caselevel').attr('guid');
if (caselevel == 100000000 || caselevel == 100000001 || caselevel == 100000002) {
if (!versionID) {
alert("请先输入版本信息再提交解决方案");
return false;
}
}
openModelDialog("添加解决方案", "/Case/CreateSolutionPage?new_case=" + new_caseBase.new_caseId + "&status=2", 500, 500);
});
$("#btnAddSolution_crm").click(function () {
//2019-04-26 SLL
var versiOnID= $('#new_productversion').attr('guid');
var caselevel = $('#new_caselevel').attr('guid');
if (caselevel == 100000000 || caselevel == 100000001 || caselevel == 100000002) {
if (!versionID) {
alert("请先输入版本信息再提交解决方案");
return false;
}
}
});
//crm的解决方案
var crmlink = "http://crm.h3c.com:5555/H3C/main.aspx?etc=10043&extraqs=%3f_CreateFromId%3d%257b" + new_caseBase.new_caseId + "%257d%26_CreateFromType%3d10027%26etc%3d10043&pagetype=entityrecord#80196053";
$("#btnAddSolution_crm").attr("href", crmlink);
var updateSolution = function (data) {
openModelDialog("编辑解决方案", "/Case/CreateSolutionPage?new_case=" + new_caseBase.new_caseId + "&status=3&new_solutiOn查看解决方案", "/Case/CreateSolutionPage?new_case=" + new_caseBase.new_caseId + "&status=4&new_solutiOn解决方案反馈", "/Case/SolutionFeedbackPage?new_solutiOn请先提交解决方案!");
return false;
}
};
var loadSolution = function () {
listDataLoad({ parameters: requestParam, url: "/Case/GetSolutionList", obj: "tb_SolutionList", operating: { "编辑": updateSolution, "查看": viewSolution, "反馈": solutionFeedback } });
};
/********* loading Solution end *********/
/********* loading Additional *********/
$("#btnApplyAdditional").click(function () {
openModelDialog("申请补充信息", "/Case/CreateAdditionalPage?new_case=" + new_caseBase.new_caseId + "&status=2", 500, 500);
});
$("#btnAddAdditional").click(function () {
openModelDialog("添加补充信息", "/Case/CreateAdditionalPage?new_case=" + new_caseBase.new_caseId + "&status=3", 500, 500);
});
var updateAddition = function (data) {
openModelDialog("编辑补充信息", "/Case/CreateAdditionalPage?new_case=" + new_caseBase.new_caseId + "&status=3&new_additiOnalinfo编辑补充信息", "/Case/CreateAdditionalPage?new_case=" + new_caseBase.new_caseId + "&status=4&new_additiOnalinfo/Case/GetAdditionList", obj: "tb_AdditionList", operating: { "补充": updateAddition, "查看": viewAddition } });
};
/********* loading Additional end *********/
/********* loading 回访 *********/
$("#btn_addvisit").click(function () {
openModelDialog("添加回访记录", '/Content/WorkItemCallback.html#{ url: "/Case/CaseCallBack", caseId: "' + case_context.caseID
+ '",new_isonsite:"' + case_context.data.new_isonsite
+ '",isserver:"' + case_context.data.IsServer
+ '" }', 520, 400);
});
var loadVisit = function () {
listDataLoad({
parameters: requestParam, url: "/Case/GetCallBackList", obj: "tb_CallBackList", operating: { "查看": viewCallBack }
});
};
var viewRma = function (data) {
var rma_link = "http://crm.h3c.com:5555/H3C/main.aspx?etn=new_rma&extraqs=&id=%7b" + data.rma_id + "%7d&newWindow=true&pagetype=entityrecord";
window.open(rma_link);
}
var viewCallBack = function (data) {
openModelDialog("查看回访记录", '/Content/WorkItemCallback.html#{ url: "/Case/CaseCallBack", new_score: "' + data.new_score
+ '",new_isonsite:"' + case_context.data.new_isonsite
+ '",new_visitresult:"' + data.new_visitresult.replace(/\n/g, " ") //对所有文本的换行显示
+ '",new_longdistatt:"' + data.new_longdistatt
+ '",new_longdisttech:"' + data.new_longdisttech
+ '",new_onsitetech:"' + data.new_onsitetech
+ '",new_onsiteatt:"' + data.new_onsiteatt
+ '",new_visitresult1Value:"' + data.new_visitresult1Value
+ '",new_backtoprocessname:"' + data.new_backtoprocessname
+ '",isserver:"' + case_context.data.IsServer
+ '",new_engineerassessValue:"' + data.new_engineerassessValue
+ '",new_serverstandardassessValue:"' + data.new_serverstandardassessValue
+ '",new_totalaccountassessValue:"' + data.new_totalaccountassessValue
+ '" }', 520, 400);
};
//loadVisit();
/********* loading 回访 end *********/
/********* loading 派单 *********/
$("#btn_assign").click(function () {
openModelDialog("创建派单", '/Content/ServiceActivity.html#{geturl: "/Case/GetAssignmentByActivityId", ' +
'createurl: "/Case/CreateServiceActivity", ' +
'completeurl: "/Case/CompleteAssignmentByActivityId", ' +
'new_caseName: "' + case_context.data.new_name + '", caseId: "' + case_context.caseID + '", ' +
'customers: "' + case_context.data.new_callincustomer.name + '", new_contact: "' + case_context.data.new_callincontact.name + '",' +
'new_secondagent:"' + case_context.data.new_secondagent + '", ' +
'new_InsideAgentName:"' + case_context.data.new_InsideAgentName + '", ' +
'new_phone: "' + case_context.data.new_phonenumber + '"}');
});
var updateAssign = function (data) {
var rv;//window.showModalDialog("/Case/CreateAdditionalPage?new_case=" + new_caseBase.new_caseId + "&status=3&new_additiOnalinfo¤tTab=" + $("#currentTab").val();
//loadAssignment();
};
var viewAssign = function (data) {
openModelDialog("查看派单", '/Content/ServiceActivity.html#{geturl: "/Case/GetAssignmentByActivityId", ' +
'createurl: "/Case/CreateServiceActivity", ' +
'completeurl: "/Case/CompleteAssignmentByActivityId", ' +
'returnurl: "/Case/ReturnAssignmentByActivityId", ' +
'activityId: "' + data.ActivityId + '", caseId: "' + case_context.caseID + '", ' +
'customers: "' + case_context.data.new_callincustomer.name + '", new_contact: "' + case_context.data.new_callincontact.name + '",' +
'new_phone: "' + case_context.data.new_phonenumber + '"}');
};
var loadAssignment = function () {
listDataLoad({ parameters: requestParam, url: "/Case/GetAssignment", obj: "tb_assignmentList", operating: { "查看": viewAssign } });
};
/********* loading 派单 end *********/
/********* loading 服务派单 *********/
$("#btn_serviceassign").click(function () {
openModelDialog("创建服务派单", '/Content/ServiceAssign.html#{geturl: "/Case/GetAssignmentByActivityId", ' +
'createurl: "/Case/CreateServiceActivity", ' +
'completeurl: "/Case/CompleteAssignmentByActivityId", ' +
'new_caseName: "' + case_context.data.new_name + '", caseId: "' + case_context.caseID + '", ' +
'customers: "' + case_context.data.new_callincustomer.name + '", new_contact: "' + case_context.data.new_callincontact.name + '",' +
'new_secondagent:"' + case_context.data.new_secondagent + '", ' +
'new_InsideAgentName:"' + case_context.data.new_InsideAgentName + '", ' +
'new_phone: "' + case_context.data.new_phonenumber + '"}');
});
/********* loading 服务派单 end *********/
/********* loading 相关案例 *********/
var viewRelatedCase = function (data) {
// window.open(data.url);
var url = "http://kms.h3c.com/case/info.aspx?"
};
listDataLoad({ parameters: parlist, url: "/Case/GetRelatedCases", obj: "tb_RelatedCaseList", events: { "caption": viewRelatedCase } });
};
//loadRelatedCase();
/********* loading 相关案例 end *********/
/********* loading 评论 *********/
$("#btn_addComment").click(function () {
openModelDialog("添加评论", "/Case/CommentPage?new_case=" + case_id, 500, 500, loadCommentlist);
});
var loadCommentlist = function () {
listDataLoad({ parameters: requestParam, url: "/Case/CommentList", obj: "tb_CommentList", operating: { "删除": deleteComment } });
};
var deleteComment = function (data) {
if (data.CreatedByName != FullName) {
alert('无删除权限');
return false;
}
confirm("是否确认删除该评论?", function () {
$.ajax({
url: '/Case/DeleteAnnotationById',
data: {
'annotationId': data.AnnotationId
},
type: "POST",
dataType: 'json',
cache: false,
async: 'false',
beforeSend: function () {
loading();
},
success: function (data) {
if (data.message) {
alert(data.message);
}
},
complete: function (xhr) {
unloading();
loadCommentlist();
}
});
});
};
//loadCommentlist();
/********* loading 评论 end *********/
/********* init ribbon event *********/
var operatiOnSuccess= function (result) {
if (result.status == 0 || result.status == 'Success') {
alert(result.message);
window.location.href = currentUrl;
}
else if (result.status == 1 || result.status == 'Failure') {
alert(result.message);
//window.location.reload(true);
}
};
$("#btn_accept").click(function () {
$.ajax({
url: "/Case/Accept",
data: { caseid: case_id },
type: "post",
dataType: 'json',
cache: false,
async: true,
beforeSend: function () {
loading();
},
success: operationSuccess,
complete: function (xhr) {
unloading();
}
});
});
$("#btn_upgrade").click(function () {
////如果没有填写产品版本,则不能升级
//if ($("#new_productversion").text().length == 0 || $("#new_productversion").text() == "--") {
// alert("升级前必须先填写产品版本!");
// return;
//}
//var new_innerproductgroup = new_caseBase.new_innerproductgroup;
//if (new_innerproductgroup && new_innerproductgroup.length > 0) {
openModelDialog("工单升级", "UpgradeCasePage?case_&status=2");
//} else {
// alert("内部产品组缺失");
//}
});
$("#btn_close").click(function () {
//如果没有填写问题级别,则不能关单
var $span_new_caselevel = $("span[id='new_caselevel']");
if ($span_new_caselevel.text().length == 0 || $span_new_caselevel.text() == "--") {
alert("关闭工单前必须先填写问题级别");
return;
}
$.ajax({
type: "GET",
url: "/Case/CheckCloseCase",
data: { caseId: case_context.caseID }, //参数 工单号caseId
dataType: "text",
cache: false,
async: false, //同步处理
success: function (data) {
//存在未完成派单时,不允许关闭工单
if (data == "0") {
var issamer = true;
if ((case_context.data.new_responsible.id != case_context.data.new_processer1.id) &&
(case_context.data.new_processer_service != null && case_context.data.new_processer_service.id != "")) { issamer = false; }
debugger;
openModelDialog("工单关闭", "/Content/workItemClose.html?rd=" + Math.random() + "#" + '{ url: "/Case/CloseCase",barcard:"' + case_context.data.new_barcode + '",new_source:"' + case_context.data.new_source + '",new_caselevel:"' + case_context.data.new_caselevel + '",status:' + case_context.data.new_casestauts + ', caseId: "' + case_context.caseID + '", servicelevel: ' + case_context.data.new_servicelevel + ',issamer:' + issamer + ',contactId:"' + case_context.data.new_callincontact.id + '",productGroup:"' + (!!(case_context.data.new_productgroup) ? case_context.data.new_productgroup.name : null) + '"}', 700, 400);
} else if (data == "1") {
alert("该工单有未完成的【派单】,不能关闭工单!");
return false;
}
else if (data == "2") {
alert("该工单有未审核或未完成的【服务器派单】,当前不能关闭工单!");
return false;
}
else if (data == "3") {
//alert("该工单有未审核或未完成的【备件单】,当前不能关闭工单!");
alert("该工单备件状态为进行中,暂无法关单");
return false;
}
},
error: function (result, status) {
//var mes = "'出错了!" + status + " "
//+ "caseID:" + caseId + " ";
return false;
}
});
});
$("#btn_transfer").click(function () {
openModelDialog("转单", "Transfor?new_case#btn_goBack").click(function () {
var right_positiOnDetail= parent.document.getElementById('right_positionDetail');
$(right_positionDetail).hide();
var right_positiOnBottom= parent.document.getElementById('right_positionBottom');
$(right_positionBottom).show();
});
/********* init ribbon event end *********/
/********************init tab ********************/
$(".case #tabs #tabtitle li").each(function (i) {
var tabpage = $($(this).attr("page"));
if ($(this).hasClass("sec2")) {
tabpage.show();
}
else {
tabpage.hide();
}
$(this).click(function () {
$("#tabs #tabtitle .sec2").removeClass("sec2").addClass("sec1");
$(this).removeClass("sec1").addClass("sec2");
var page = $(this).attr("page");
$("#currentTab").val(this.id);
$("#tabs .tabpage").hide();
$(page).show();
if ($(page).attr("loaded") != "true") {
switch (page) {
case "#tabs-1":
loadCommentlist();
break;
case "#tabs-2":
loadProgress();
break;
case "#tabs-3":
loadAddtional();
break;
case "#tabs-4":
loadSolution();
break;
case "#tabs-7":
loadVisit();
break;
case "#tabs-8":
loadAssignment();
break;
case "#tabs-9":
loadRelatedCase();
break;
case "#tabs-10":
loadDealprodure();
break;
case "#tabs-11":
loadRmaList();
break;
}
$(page).attr("loaded", "true");
}
});
});
$("#tabs #tabtitle li").get(0).click();
//else if (this.Model.new_casestauts == 100000012)
//{
// $("#tabs #tabtitle li").get(4).click();
//}
/********************init tab end********************/
});
var closeDialog = function (refrush) {
$("#modelWin").dialog("close");
refrush = refrush || true;
if (refrush)
window.location.href = currentUrl + "¤tTab=" + $("#currentTab").val();
}
设备重启时ctrl+B,然后又一个跳过当前密码,去登录即可,8是跳过密码登录设备
===========================<EXTENDED-BOOTWARE MENU>===========================
|<1> Boot System
|<2> Enter Serial SubMenu
|<3> Enter Ethernet SubMenu
|<4> File Control
|<5> Restore to Factory Default Configuration
|<6> Skip Current System Configuration
|<7> BootWare Operation Menu
|<8> Skip Authentication for Console Login
|<9> Storage Device Operation
|<0> Reboot
暂无评论