| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- /**
- * 查看工单详情
- * */
- $(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 = $(
- '<li><span class="img_mask"><a href="' + v.fileurl + '" download="filename" title="点击下载"><i class="glyphicon glyphicon-download-alt" aria-hidden="true"></i></a></span>' +
- '<img layer-src="' + v.fileurl + '" alt="'+ v.filename +'" src="' + v.filesmallurl + '" title="图片"/>' +
- '<span class="file_name">' + v.filename + '</span>' +
- '</li>'
- );
- $list.append($li);
- } else {
- var $liFile = $(
- '<li><span class="img_mask"><a href="' + v.fileurl + '" download="filename" title="点击下载"><i class="glyphicon glyphicon-download-alt" aria-hidden="true"></i></a></span>' +
- '<div class="noThumb" title="文件"><i class="glyphicon glyphicon-paperclip"></i><p>无法预览</p></div>' +
- '<span class="file_name">' + v.filename + '</span>' +
- '</li>'
- );
- $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('<p class="abnormal">暂无内容。。。</p>');
- }
- }
- });
- }
|