Nessuna descrizione

seeOrderDetails.js 3.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /**
  2. * 查看工单详情
  3. * */
  4. $(function() {
  5. var pro_id = helper.request.queryString("edit_id");
  6. getProjectDetail(pro_id);
  7. });
  8. //获取单个
  9. function getProjectDetail(ids) {
  10. $.getJSON(huayi.config.callcenter_url + "callcenterapi/api/BusOrder/getsingle", {
  11. ordercode: ids,//是 string 工单编号
  12. }, function(data) {
  13. if(data.state == "success") {
  14. var res = data.data.model;
  15. $('#order_code').html(res.ordercode); //工单编号
  16. $('#order_source').html(res.sourcename); //工单来源
  17. $('#order_type').html(res.typename); //工单类型
  18. var locations = '';
  19. var address = '';
  20. if(res.provincename ){
  21. locations = res.provincename + res.cityname;
  22. }
  23. if(res.address){
  24. address = res.address;
  25. }
  26. $('#order_address').html(locations + address); //地址
  27. $('#order_name').html(res.name); //姓名
  28. $('#order_tel').html(res.phone); //电话
  29. $('#order_sex').html(res.sex); //性别
  30. $('#userCode').html(res.createuser + '-' + res.createusername); //创建人
  31. $('#createTime').html(res.createtime); //创建时间
  32. $('#order_count').html(helper.filter.content(res.content)); //内容
  33. var EnclosureList = res.files;
  34. if(EnclosureList && EnclosureList.length > 0) {
  35. var $list = $("#fileList");
  36. $.each(EnclosureList, function(i, v) {
  37. if(v.filesmallurl) {
  38. //原来的图片
  39. var $li = $(
  40. '<li><span class="img_mask"><a href="' + v.fileurl + '" download="filename" title="点击下载"><i class="glyphicon glyphicon-download-alt" aria-hidden="true"></i></a></span>' +
  41. '<img layer-src="' + v.fileurl + '" alt="'+ v.filename +'" src="' + v.filesmallurl + '" title="图片"/>' +
  42. '<span class="file_name">' + v.filename + '</span>' +
  43. '</li>'
  44. );
  45. $list.append($li);
  46. } else {
  47. var $liFile = $(
  48. '<li><span class="img_mask"><a href="' + v.fileurl + '" download="filename" title="点击下载"><i class="glyphicon glyphicon-download-alt" aria-hidden="true"></i></a></span>' +
  49. '<div class="noThumb" title="文件"><i class="glyphicon glyphicon-paperclip"></i><p>无法预览</p></div>' +
  50. '<span class="file_name">' + v.filename + '</span>' +
  51. '</li>'
  52. );
  53. $list.append($liFile);
  54. }
  55. });
  56. layer.photos({
  57. photos: '#fileList',
  58. anim: 5, //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
  59. title: '查看图片',
  60. move: '.layui-layer-title',
  61. shadeClose: false,
  62. closeBtn: 1,
  63. area: ['80%', '90%'],
  64. tab: function(pic, layero) {
  65. $('.layui-layer-content').on("mousewheel", function(e, d) {
  66. console.log(e);
  67. console.log(d);
  68. helper.methods.zoomImg($('#layui-layer-photos').find('img[alt="' + pic.alt + '"]'), d);
  69. $('#layui-layer-photos').find('img[alt="' + pic.alt + '"]').dragging({
  70. move: "both", //拖动方向,x y both
  71. randomPosition: false //初始位置是否随机
  72. });
  73. return false;
  74. });
  75. helper.methods.initLayerPhotos('#layui-layer-photos', pic, layero);
  76. },
  77. });
  78. } else {
  79. $("#fileList").html('<p class="abnormal">暂无内容。。。</p>');
  80. }
  81. }
  82. });
  83. }