').appendTo("#IMG_box");
} else {
$('
').appendTo("#IMG_box");
}
});
layer.photos({
photos: '#IMG_box',
anim: 5, //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
title: '查看图片',
move: '.layui-layer-title',
shadeClose: false,
closeBtn: 1,
area: ['80%', '90%'],
tab: function(pic, layero) {
helper.methods.initLayerPhotos('#layui-layer-photos', pic, layero);
},
});
}
}
}
});
}
//处理
function dealWorkOrder(oid) {
var infotype = $('#xl_box').find('option:selected').text();
var infotypedetail = $('#xq_rdwt').find('option:selected').text();
if (infotype == '请选择') {
infotype = ''
}
if (infotypedetail == '请选择') {
infotypedetail = ''
}
if($('#cont').val() == '') {
layer.confirm('请输入问题处理情况!', {
icon: 2,
btn: ['确定']
});
return;
}
$.post(huayi.config.callcenter_url + 'WorkOrder/DealWorkOrder', {
orderid: oid, //string 是 工单编号
customer: $('#cl_khxm').val(), //string 是 客户姓名
country: $('#t_county').val(), //string 否 乡镇或单位
//country: $("#t_county").find("option:selected").text(),
address: $('#t_address').val(), //string 否 住址
inqtime: $('#t_inqtime').val(), //string 否 调查时间
inquser: $('#t_inquser').val(), //string 否 调查员
detail: $('#t_detail').val(), //string 是 反映问题
// answer: $('#t_answer').val(), //string 否 回访反馈情况
cont: $('#cont').val(), //问题处理情况
remark: $('#t_remarks').val(), //string 否 备注
isend: $("input[name='ltype']:checked").val(), //int 是 是否结束 0否,1是
isrestore: $("input[name='isT']:checked").val(), //是否修复
unit: $("#clbmname").val(), //string 否 交办单位
infotype: infotype, //string 否 信息分类
infotypeid: $('#xl_box').val(),
infotypedetail: infotypedetail,
infotypedetailid: $('#xq_rdwt').val(),
clbm: $("#clbmname").val(), //string 否 处理部门
clgh: $("#clidname").val(), //string 否 处理人
token: $.cookie("token")
}, function(result) {
result = $.parseJSON(result);
if (result.state.toLowerCase() == "success") {
var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
parent.layer.close(index); //再执行关闭
parent.initTable();
parent.Hiden();
parent.layer.msg("处理工单成功");
}
})
}
$('#xl_box').change(function() {
getInfotypedetail($('#xq_rdwt'), $('#xl_box').find('option:selected').text())
})
function getInfotypedetail(obj, val, name) {
$.getJSON(huayi.config.callcenter_url + 'Dictionary/GetDicValueListByDescribe', {
"token": $.cookie("token"),
des: val
}, function(result) {
if (result.state.toLowerCase() == "success") {
let str = '
'
result.data.forEach(function(v, n) {
str += '
'
})
obj.html(str)
if (name) {
$('#xq_rdwt').val(name)
}
}
})
}
//下拉选项
//20180518byfanlongfei将处理部门、处理人、信息分类、交办单位修改为文本框;
// getBM($("#zrbmtree"));
// getBM($("#clbmtree"));
//标签切换
$(".ldtp-cr ul.ld-service li").click(function() {
$(this).addClass("cr-click").siblings().removeClass("cr-click");
var index = $(this).index();
$(".gsxx").find(".sqzx").eq(index).addClass("Shows").siblings().removeClass("Shows");
if (index == 2) {
getLX($(".tslx"), "TSLX");
getBM($("#zrbmtree"));
getBM($("#clbmtree"));
}
});
//tree下拉框效果
$(".inpBox .tree").click(function() {
if ($(this).parent().find(".addTree").is(":hidden")) {
$(this).parent().find(".addTree").show();
} else {
$(this).parent().find(".addTree").hide();
}
});
//普通下拉框效果
$(".inpBox .select").click(function() {
if ($(this).parent().find(".xl_common").is(":hidden")) {
$(this).parent().find(".xl_common").show();
} else {
$(this).parent().find(".xl_common").hide();
}
});
$(".xl").click(function() {
if ($(this).parent().find(".addTree").is(":hidden")) {
$(this).parent().find(".addTree").show();
} else {
$(this).parent().find(".addTree").hide();
}
if ($(this).parent().find(".xl_common").is(":hidden")) {
$(this).parent().find(".xl_common").show();
} else {
$(this).parent().find(".xl_common").hide();
}
});
$(".inpBox").mouseleave(function() {
$(this).children(".xl_common").hide();
$(this).children(".addTree").hide();
})
//删除
$(".inpBox").hover(function(event) {
$(this).children(".de_icon").show();
event.stopPropagation();
}, function() {
$(this).children(".de_icon").hide();
});
$(".de_icon").click(function(event) {
event.stopPropagation();
$(this).siblings("input").eq(0).val("");
$(this).siblings("input").eq(1).val("");
if ($(this).siblings("div").find("ul").attr("id") == "zrbmtree") {
getRY($(".zrid"), $("#zrbm").val());
}
if ($(this).siblings("div").find("ul").attr("id") == "clbmtree") {
getRY($(".clid"), $("#clbm").val());
}
});
//20180518byfanlongfei将处理部门、处理人、信息分类、交办单位修改为文本框;
//获取部门
//营业部(部门)
function getDepartList(obj) {
obj.empty();
let str = '
'
$.getJSON(huayi.config.callcenter_url + 'CallOutPlan/GetDepartList', {
"token": $.cookie("token")
}, function(result) {
if (result.state.toLowerCase() == "success") {
result.data.forEach(function(v, n) {
str += '
'
})
obj.html(str)
}
})
}
//获取处理人员
$('#clbmname').change(function() {
getUserListByDepartment($('#clidname'), $('#clbmname').val())
})
function getUserListByDepartment(obj, deptid, name) {
obj.empty();
let str = ''
$.getJSON(huayi.config.callcenter_url + 'CallInScreen/getUserListByDepartment', {
"token": $.cookie("token"),
deptid: deptid
}, function(result) {
if (result.state.toLowerCase() == "success") {
result.data.forEach(function(v, n) {
str += '
'
})
obj.html(str)
if (name) {
$("#clidname").val(name)
}
}
})
}
//获取类型
function getLX(obj, type) {
obj.empty();
$.getJSON(huayi.config.callcenter_url + 'Dictionary/GetDicValueListByFlag', {
"flag": type,
"token": $.cookie("token")
}, function(result) {
if (result.state.toLowerCase() == "success") {
$(result.data).each(function(i, n) {
obj.append('
' + n.F_Name + '');
})
obj.find("li").click(function(event) {
if (event) {
event.stopPropagation();
}
$(this).parent().parent().parent().find("input").eq(0).val($(this).text());
$(this).parent().parent().parent().find("input").eq(1).val($(this).attr("itemid"));
$(this).parent().parent().hide();
});
}
})
}
//下载
function downloadFile(data, strFileName, strMimeType) {
console.log(111)
event.preventDefault();
//详细见文档 http://danml.com/download.html
var x = new XMLHttpRequest();
x.open("GET", data, true);
x.responseType = 'blob';
x.onload = function(e) {
download(x.response, strFileName, strMimeType);
}
x.send();
}