فهرست منبع

委托管理搜索栏

15168162575 2 سال پیش
والد
کامیت
4f09e228c9
2فایلهای تغییر یافته به همراه13 افزوده شده و 2 حذف شده
  1. 11 0
      application/admin/controller/Entrust.php
  2. 2 2
      public/assets/js/backend/entrust.js

+ 11 - 0
application/admin/controller/Entrust.php

@@ -82,7 +82,18 @@ class Entrust extends Backend
         $result = ['total' => $list->total(), 'rows' => $list->items()];
         return json($result);
     }
+    /**
+     * 搜索栏检测项目下拉列表
+     */
+    public function companyselect(){
+        $company = Db::name('item_judge')->column('name,name');
+        if (empty($company)){
+            return $this->error('没有检测项目数据');
+        }else{
+            return json($company);
+        }
 
+    }
     /**
      * 添加
      *

+ 2 - 2
public/assets/js/backend/entrust.js

@@ -44,8 +44,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                 }
                             }},
 
-                        {field: 'standard_name', title: __('Standard_name'), operate:false},
-                        {field: 'data_status', title: __('检测数据'),operate:false,formatter: function (value,row,index) {
+                        {field: 'standard_name', title: __('Standard_name'), searchList: $.getJSON("entrust/companyselect")},
+                        {field: 'data_status', title: __('检测数据'),searchList: {"0":'无',"1":'已有'}, formatter: Table.api.formatter.status,function (value,row,index) {
                                 if (value == 0){
                                     value = '';
                                     return '<span style="color: #f75444">' +value+ '</span>';