| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429 |
- /**
- * 工单分配
- * */
- $(document).ready(function() {
- autosize($('textarea'));
- var ID = helper.request.queryString("oid"); //工单编号
- if(ID) {
- getWorkOrderInfo(ID);
- }
- //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(".addTree").hide();
- $(this).children(".xl_common").hide();
- });
-
- $(".xl_box").on("click", "li", function() {
- var obj = $(this).parent().parent().parent();
- obj.find("input").eq(0).val($(this).text());
- obj.find("input").eq(1).val($(this).attr("itemid"));
- obj.find(".xl_common").hide();
- });
-
- getBM($("#zrbmtree"));
-
- //点击确定
- $("#clgd").click(function() {
- if(!$("#clbm").val()) {
- layer.confirm('请选择接收部门!', {
- icon: 2,
- btn: ['确定']
- });
- return;
- }
- // if(!$("#cont").val()) {
- // layer.confirm('请输入处理内容!', {
- // icon: 2,
- // btn: ['确定']
- // });
- // return;
- // }
- dealWorkOrder(ID);
- });
- })
- $("#clbm").blur(function(){
- // alert($("#clbm").val())
- // if($("#clbm").find("input").text()=="市场管理科"){
- // $("#abcd").show()
- // }else{
- // $("#abcd").hide()
- // }
-
- })
- $('#yijian').find('input[type="radio"]').on('change', function() {
- if($(this).val() == "不同意") { //业务办理
- $('#nnn,#nnn').show();
- }else{
- $('#nnn,#nnn').hide();
- }
- });
- $('#buchang').find('input[type="radio"]').on('change', function() {
- if($(this).val() == "钱款") { //业务办理
- $('#mmm,#mmm').show();
- }else{
- $('#mmm,#mmm').hide();
- }
- });
- //获取工单信息
- function getWorkOrderInfo(oid) {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "WorkOrderNew/GetDetails",
- async: true,
- dataType: 'json',
- data: {
- id: oid,
- token: $.cookie("token")
- },
- success: function(data) {
- /*验证请求*/
- if(data.state == "success") {
- var Str = data.rows;
- if(Str && Str.length > 0) {
- $('#cl_gdbh').text(Str[0].F_WorkOrderCode); //工单编号
- $("#cl_gdlx").text(Str[0].F_TypeName); //工单类型
-
- $("#xq_source").text(Str[0].F_SourceName); //工单来源
- // $("#xq_handle").text(Str[0].YWLXName); //业务办理
- $("#cl_khxm").text(Str[0].F_CusName); //姓名
- $("#cl_khdh").text(helper.filter.cutTel(Str[0].F_CusPhone)); //电话
- $('#cl_gdnr').text(decodeURIComponent(Str[0].Detail));
- // if($("#cl_gdlx").text()=="抽检"){
- // alert(Str[0].F_TypeName)
- // }else if($("#cl_gdlx").text()=="投诉"){
- // alert(Str[0].F_TypeName)
- // } else{
- // alert(Str[0].F_TypeName)
- // }
-
- //微信内文件(暂时不用)
- var Files = Str[0].Files;
- if(Files) {
- var a;
- var b;
- $(Files).each(function(i, n) {
- a = n.F_FileType.split("\/")[0];
- b = n.F_FileName.split(".")[1];
- // console.log(a);
- if(a == 'image') {
- $('<div class="img-box"><a href="+' + n.F_FileUrl + '" download="' + n.F_FileName + '"><img src="' + n.F_FileUrl + '" alt="" class="image-item" data-preview-group="1" /><span class="">' + b + '</span></a><div>').appendTo(".space");
- } else {
- $('<div class="img-box "><a href="+' + n.F_FileUrl + '" download="' + n.F_FileName + '"><span class="">' + b + '</span></a><div>').appendTo(".space");
- }
- })
- }
- }
- }
- }
- });
- }
- //获取工单类型
- function getTypeName(val) {
- var str = '';
- switch(val + '') {
- case '1':
- str = "咨询";
- break;
- case '2':
- str = "投诉";
- break;
- case '3':
- str = "抽检";
- break;
- // case '4':
- // str = "其他";
- // break;
- }
- return str;
- }
- //获取部门
- var setting = {
- data: {
- key: {
- name: "text"
- },
- simpleData: {
- enable: true,
- idKey: "id",
- pIdKey: "ParentId",
- rootPId: 0
- }
- },
- callback: {
- onClick: zTreeOnClick
- }
- };
- function getBM(obj) {
- $.getJSON(huayi.config.callcenter_url + 'Department/GetDeptList', {
- token: $.cookie("token")
- }, function(result) {
- if(result.state.toLowerCase() == "success") {
- var treeObj = $.fn.zTree.init(obj, setting, result.data);
- treeObj.expandAll(true);
- }
- })
- }
- function zTreeOnClick(event, treeId, treeNode) {
- if(event) {
- event.stopPropagation();
- }
- var obj = $("#" + event.data.treeId).parent();
- obj.parent().find("input").eq(0).val(treeNode.text);
- obj.parent().find("input").eq(1).val(treeNode.id);
- obj.hide();
- getRY($(".clid"), $("#clbm").val());
- //alert($("#clbm").val());
-
- if ($("#clbm").val()==37) {
- if($("#cl_gdlx").text()=="抽检"){
- $("#abcde").show();
- $("#abcdef").hide();
- }else if($("#cl_gdlx").text()=="投诉"){
- $("#abc").show();
- $("#abcd").hide();
- }else if($("#cl_gdlx").text()=="咨询"){
- $("#abc").show();
- $("#abcd").hide();
- }
- }
-
- if ($("#clbm").val()==12) {
- if($("#cl_gdlx").text()=="抽检"){
- $("#abcdef").show();
- $("#abcde").hide();
- }else if($("#cl_gdlx").text()=="投诉"){
- $("#abcd").show();
- $("#abc").hide();
- }else if($("#cl_gdlx").text()=="咨询"){
- $("#abcd").show();
- $("#abc").hide();
- }
- }
-
- };
- //获取人员
- function getRY(obj, deptid) {
- var proid = helper.request.queryString("proid"); //项目id
- obj.empty();
- obj.append('<li itemid="">--请选择--</li>');
- obj.parent().parent().find("input").eq(0).val("--请选择--");
- obj.parent().parent().find("input").eq(1).val("");
- $.getJSON(huayi.config.callcenter_url + 'UserAccount/GetDeptUserList', {
- proid: proid,
- deptid: deptid,
- token: $.cookie("token")
- }, function(result) {
- if(result.state.toLowerCase() == "success") {
- $(result.data).each(function(i, n) {
- obj.append('<li itemid="' + n.F_UserId + '">' + n.F_UserName + '(' + n.F_UserCode + ')</li>');
- });
- 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 dealWorkOrder(oid) {
- // var ltype = $("input[name='ltype']:checked").val();
- var isDetail = helper.request.queryString("isDetail"); //是否是详情页面的处理
-
- // if($.trim($('#clbmname').val()) && !$('#clid').val()){
- // layer.confirm('请选择接收人!', {
- // icon: 2,
- // btn: ['确定']
- // });
- // return;
- // }
-
- $.post(huayi.config.callcenter_url + 'WorkOrderNew/AssignWorkOrder', {
- orderid: oid, //否 strubg 工单ID
- // isend: ltype, //否 int
- overtime: $("#Depth").val(), //是否短信回访
- clbm: $("#clbm").val(), //是 int 部门Id
- clid: $("#clid").val(), //否 int 接收人用户id
- cont: $("#cont").val(), //否 int 处理内容
- sms: $("#duanxin").find('input[type="radio"]:checked').val(),//短信提醒
- QualityMonth: $("#zhibao").val(), //否 int 处理内容
- PreliminaryOpinion: $("#chushen").val(),
- isvisit: $("#huifang").find('input[type="radio"]:checked').val(),
- QualityEventLevel: $("#dengji").val(),
- ApprovalDisagree: $("#butong").val(),
- ResponsibleUnit: $("#duoxuan").find('input[type="checkbox"]:checked').val(),
- ApprovalOpinions: $("#yijian").find('input[type="radio"]:checked').val(),
- CompensationMethod: $("#buchang").find('input[type="radio"]:checked').val(),
- CompensationMoney: $("#buqian").val(),
- CResponsibleUnits: $("#danwei").val(),
- Fquantity: $("#shuliang").val(),
- ImprovementRequirements: $("#yaoqiu").val(),
- CApprovalNo: $("#danhao").val(),
-
- SpotResult: $("#chou").val(),
- SelfResult: $("#zijian").val(),
- ApprovalNo: $("#duiying").val(),
- ReturnAccount: $("#shenpi").val(),
-
- isvisit: $("#hui_FA").find('input[type="radio"]:checked').val(),
- IsRecord: $("#shenpi").val(),
- ClaimAmount: $("#suopeijin").val(),
- token: $.cookie("token")
- }, function(result) {
- result = $.parseJSON(result);
- if(result.state.toLowerCase() == "success") {
- if(isDetail === "true") {
- parent.parent.layer.closeAll();
- parent.parent.$('#orderlist').bootstrapTable('refresh');
- parent.parent.layer.msg("工单转派成功!");
- } else {
- var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- parent.layer.close(index); //再执行关闭
- parent.$('#workorderlist').bootstrapTable('refresh');
- parent.$('.Closed').trigger('click');
- parent.layer.msg("工单转派成功!");
- }
- top.workcount();
- }
- })
- }
- $(document).ready(function () {
- var wid = helper.request.queryString("wid");
- // CPZL($("#zhibao"));//产品种类
- SCCS($("#chushen"));//初审意见
- ZLSJDJ($("#dengji"));//质量事件等级
- ZLZRDW($("#danwei"));//责任单位
- SCCJJG($("#chou"));//责任单位
-
- });
- // function CPZL(obj) {
- // obj.empty();
- // obj.append('<option selected="selected" value="">请选择</option>');
- // $.getJSON(huayi.config.callcenter_url + "WorkOrder/GetProTime", {
- // "token": $.cookie("token"),
- // flag:"CPZL",
- // }, function (data) {
- // if (data.state.toLowerCase() == "success") {
- // var content = data.data;
- // $(content).each(function (i, n) {
- // $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
- // })
- // }
- // })
- // }
- function SCCS(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
- "token": $.cookie("token"),
- flag:"SCCS",
- }, function (data) {
- if (data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function (i, n) {
- $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
- })
- }
- })
- }
- //质量事件等级
- function ZLSJDJ(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
- "token": $.cookie("token"),
- flag:"ZLSJDJ",
- }, function (data) {
- if (data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function (i, n) {
- $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
- })
- }
- })
- }
- //责任单位
- function ZLZRDW(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
- "token": $.cookie("token"),
- flag:"ZLZRDW",
- }, function (data) {
- if (data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function (i, n) {
- $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
- })
- }
- })
- }
- //抽检结果
- function SCCJJG(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag", {
- "token": $.cookie("token"),
- flag:"SCCJJG",
- }, function (data) {
- if (data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function (i, n) {
- $("<option value='" + n.F_Name + "'>" + n.F_Name + "</option>").appendTo(obj);
- })
- }
- })
- }
|