/** * 查看工单详情 * */ $(function() { var pro_id = helper.request.queryString("edit_id"); getProjectDetail(pro_id); }); //获取单个 function getProjectDetail(ids) { $.getJSON(huayi.config.callcenter_url + "callcenterapi/api/BusOrder/getsingle", { ordercode: ids,//是 string 工单编号 }, function(data) { if(data.state == "success") { var res = data.data.model; $('#order_code').html(res.ordercode); //工单编号 $('#order_source').html(res.sourcename); //工单来源 $('#order_type').html(res.typename); //工单类型 var locations = ''; var address = ''; if(res.provincename ){ locations = res.provincename + res.cityname; } if(res.address){ address = res.address; } $('#order_address').html(locations + address); //地址 $('#order_name').html(res.name); //姓名 $('#order_tel').html(res.phone); //电话 $('#order_sex').html(res.sex); //性别 $('#userCode').html(res.createuser + '-' + res.createusername); //创建人 $('#createTime').html(res.createtime); //创建时间 $('#order_count').html(helper.filter.content(res.content)); //内容 var EnclosureList = res.files; if(EnclosureList && EnclosureList.length > 0) { var $list = $("#fileList"); $.each(EnclosureList, function(i, v) { if(v.filesmallurl) { //原来的图片 var $li = $( '
  • ' + ''+ v.filename +'' + '' + v.filename + '' + '
  • ' ); $list.append($li); } else { var $liFile = $( '
  • ' + '

    无法预览

    ' + '' + v.filename + '' + '
  • ' ); $list.append($liFile); } }); layer.photos({ photos: '#fileList', anim: 5, //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数) title: '查看图片', move: '.layui-layer-title', shadeClose: false, closeBtn: 1, area: ['80%', '90%'], tab: function(pic, layero) { $('.layui-layer-content').on("mousewheel", function(e, d) { console.log(e); console.log(d); helper.methods.zoomImg($('#layui-layer-photos').find('img[alt="' + pic.alt + '"]'), d); $('#layui-layer-photos').find('img[alt="' + pic.alt + '"]').dragging({ move: "both", //拖动方向,x y both randomPosition: false //初始位置是否随机 }); return false; }); helper.methods.initLayerPhotos('#layui-layer-photos', pic, layero); }, }); } else { $("#fileList").html('

    暂无内容。。。

    '); } } }); }