瀏覽代碼

优化搜索功能

liuhairui 2 年之前
父節點
當前提交
232ca9d192

+ 24 - 0
application/admin/controller/Res.php

@@ -250,6 +250,30 @@ class Res extends Backend
             $this->error('参数错误');
         }
     }
+
+    /**
+     * 搜索栏检测项目下拉列表
+     */
+    public function companyselect(){
+        $company = Db::name('item_judge')->where('delete',null)->order('weigh asc')->column('name,name');
+        if (empty($company)){
+            return $this->error('没有检测项目数据');
+        }else{
+            return json($company);
+        }
+
+    }
+
+    /**
+     * 搜索栏检测项目检测设备精准查找
+     */
+    public function machineselect(){
+        echo "<pre>";
+        print_r(input(''));
+        echo "</pre>";
+
+    }
+
     //excel格式
     public function exceloutput($data){
         vendor("phpoffice/phpspreadsheet/src/PhpSpreadsheet/Spreadsheet");

+ 1 - 1
application/admin/lang/zh-cn/entrust.php

@@ -9,7 +9,7 @@ return [
     'Company'       => '生产单位',
     'Sample_no'     => '样品编号',
     'Standard_id'   => '选用限量标准id',
-    'Standard_name' => '选用限量标准名称',
+    'Standard_name' => '判定标准',
     'Sample_status' => '样品状态',
     'Create'        => '委托日期',
     'Status'        => '状态',

+ 1 - 1
application/admin/lang/zh-cn/res.php

@@ -8,7 +8,7 @@ return [
     'Bach'          => '生产批次号',
     'Sample_no'     => '样品编号',
     'Standard_id'   => '限量标准id',
-    'Standard_name' => '选用限量标准名称',
+    'Standard_name' => '判定标准',
     'Dis'           => '溶剂残留总量',
     'Dis_impurity'  => '溶剂杂质总量',
     'Ben_total'     => '苯系物总量',

+ 4 - 4
public/assets/js/backend/res.js

@@ -30,7 +30,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     [
                         {checkbox: true},
                         {field: 'id', title: __('Id'),operate: false},
-                        {field: 'entrust_no', title: __('Entrust_no'), operate: 'LIKE'},
+                        {field: 'entrust_no', title: __('Entrust_no'), operate:  false},
                         {field: 'name', title: __('Name'), operate: 'LIKE'},
                         {field: 'bach', title: __('Bach'), operate: 'LIKE'},
                         {field: 'dis', title: __('Dis'),operate: false},
@@ -38,7 +38,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'ben_total', title: __('Ben_total'),operate: false},
                         {field: 'ben', title: __('Ben'),operate: false},
                         {field: 'unit', title: __('Unit'),operate: false},
-                        {field: 'judge', title: __('Judge'),operate: false,formatter: function (value,row,index) {
+                        {field: 'judge', title: __('Judge'), operate: 'LIKE',searchList: {"0":'不合格',"1":'合格'}, formatter: Table.api.formatter.status,function (value,row,index) {
                                 if (value == 1){
                                     value = '合格';
                                     return '<span style="color: #18bc9c">' +value+ '</span>';
@@ -48,10 +48,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                 }
                             }},
                         // {field: 'entrust_id', title: __('Entrust_id')},
-                        {field: 'machine', title: __('Machine'), operate: 'LIKE'},
+                        {field: 'machine', title: __('Machine'), operate: ''},
                         {field: 'sample_no', title: __('Sample_no'), operate: 'LIKE'},
                         // {field: 'standard_id', title: __('Standard_id')},
-                        {field: 'standard_name', title: __('Standard_name'), operate: 'LIKE'},
+                        {field: 'standard_name', title: __('Standard_name'), operate: 'LIKE',searchList: $.getJSON("res/companyselect")},
                         {field: 'create', title: __('Create'),operate: 'RANGE_DATE', addclass: 'datetimerange', formatter: Table.api.formatter.date,datetimeFormat:'YYYY-MM-DD'},
                         {field: 'maker', title: __('Maker'),operate: false},
                         {field: 'remark', title: __('Remark'),operate: false},