moonsflyer 9 luni în urmă
părinte
comite
f18187d016
1 a modificat fișierele cu 11 adăugiri și 3 ștergeri
  1. 11 3
      public/assets/js/backend/qingdong/customer/cusrecord.js

+ 11 - 3
public/assets/js/backend/qingdong/customer/cusrecord.js

@@ -55,11 +55,19 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                             return '';
                         },operate:true},
                     {field : 'file', title : '文件', formatter : function (value, row, index) {
+            
                             $file = '';
                            for (i=0;i<value.length;i++){
-                               $file =$file + '<a href="'+value[i]["file_path"]+'" target="_blank" style="margin-right:10px;">'+
-                                   value[i]['name']+
-                                '</a></br>';
+                               if(value[i]["types"] == "application/pdf" ||value[i]["types"] == "text/plain"){
+                                   $file =$file + '<a href="'+value[i]["file_path"]+'" download="" style="margin-right:10px;">'+
+                                       value[i]['name']+
+                                       '</a></br>';
+                               }else{
+                                   $file =$file + '<a href="'+value[i]["file_path"]+'"  target="_blank" style="margin-right:10px;">'+
+                                       value[i]['name']+
+                                       '</a></br>';
+                               }
+
                            }
                             return $file;
                         },operate:false},