瀏覽代碼

变更筛选为搜索。修复英文超出。

gzjzss 7 年之前
父節點
當前提交
6b3c2a668f

+ 0 - 1
application/controllers/Workorder.php

@@ -594,7 +594,6 @@ class Workorder extends MY_Controller
                     $workorder_info['remark_list'][] = $remarks;
                 }
                 $workorder_info['status'] = "30";
-                $resp = array();
                 if ($action == "check") {
                     $resp = $this->notices->check_workorder($workorder_info, $remarks);
                 } elseif ($action == "doit") {

+ 13 - 12
application/libraries/Notices.php

@@ -71,9 +71,9 @@ class Notices{
             }elseif($this->setting['sms_type'] == '20' ){
                 $sms_content = array(
                     "workorder_id"=>$workorder['workorder_id'],
-                    "workorder_name"=>strlen($workorder['workorder_name'])<=18?$workorder['workorder_name']:substr($workorder['workorder_name'],0,18)."..",
+                    "workorder_name"=>mb_strlen($workorder['workorder_name'],'utf-8')<=18?$workorder['workorder_name']:mb_substr($workorder['workorder_name'],0,18,'utf-8')."..",
                     "workorder_type"=>$workorder['type'],
-                    "remark_content"=>strlen($workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content'])<=18?$workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content']:substr($workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content'],0,18).".."
+                    "remark_content"=>mb_strlen($workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content'],'utf-8')<=18?$workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content']:mb_substr($workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content'],0,18,'utf-8').".."
                 );
                 $resp = $this->Aliyunsms->sendSms($receive_user['mobile'],$this->setting['template_codes'][0],$sms_content);
                 if($resp['Code'] == 'OK'){
@@ -184,10 +184,10 @@ class Notices{
                 }elseif($this->setting['sms_type'] == '20' ){
                     $sms_content = array(
                         "workorder_id"=>$workorder['workorder_id'],
-                        "workorder_name"=>strlen($workorder['workorder_name'])<=18?$workorder['workorder_name']:substr($workorder['workorder_name'],0,18)."..",
+                        "workorder_name"=>mb_strlen($workorder['workorder_name'],'utf-8')<=18?$workorder['workorder_name']:mb_substr($workorder['workorder_name'],0,18,'utf-8')."..",
                         "workorder_type"=>$workorder['type'],
                         "receive_user_name"=>$receive_user['name'],
-                        "remark_content"=>strlen($workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content'])<=18?$workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content']:substr($workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content'],0,18).".."
+                        "remark_content"=>mb_strlen($workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content'],'utf-8')<=18?$workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content']:mb_substr($workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content'],0,18,'utf-8').".."
                     );
                     $resp = $this->Aliyunsms->sendSms($notices_log['mobile'],$this->setting['template_codes'][1],$sms_content);
                     if($resp['Code'] == 'OK'){
@@ -298,10 +298,10 @@ class Notices{
                 }elseif($this->setting['sms_type'] == '20' ){
                     $sms_content = array(
                         "workorder_id"=>$workorder['workorder_id'],
-                        "workorder_name"=>strlen($workorder['workorder_name'])<=18?$workorder['workorder_name']:substr($workorder['workorder_name'],0,18)."..",
+                        "workorder_name"=>mb_strlen($workorder['workorder_name'],'utf-8')<=18?$workorder['workorder_name']:mb_substr($workorder['workorder_name'],0,18,'utf-8')."..",
                         "workorder_type"=>$workorder['type'],
                         "receive_user_name"=>$receive_user['name'],
-                        "remark_content"=>strlen($workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content'])<=18?$workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content']:substr($workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content'],0,18).".."
+                        "remark_content"=>mb_strlen($workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content'],'utf-8')<=18?$workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content']:mb_substr($workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content'],0,18,'utf-8').".."
                     );
                     $resp = $this->Aliyunsms->sendSms($notices_log['mobile'],$this->setting['template_codes'][2],$sms_content);
                     if($resp['Code'] == 'OK'){
@@ -417,14 +417,15 @@ class Notices{
                 }elseif($this->setting['sms_type'] == '20' ){
                     $sms_content = array(
                         "workorder_id"=>$workorder['workorder_id'],
-                        "workorder_name"=>strlen($workorder['workorder_name'])<=18?$workorder['workorder_name']:substr($workorder['workorder_name'],0,18)."..",
+                        "workorder_name"=>mb_strlen($workorder['workorder_name'],'utf-8')<=18?$workorder['workorder_name']:mb_substr($workorder['workorder_name'],0,18,'utf-8')."..",
                         "workorder_type"=>$workorder['type'],
                         "receive_user_name"=>$receive_user['name'],
-                        "remark_content"=>strlen($workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content'])<=18?$workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content']:substr($workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content'],0,18).".."
+                        "remark_content"=>mb_strlen($workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content'],'utf-8')<=18?$workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content']:mb_substr($workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content'],0,18,'utf-8').".."
                     );
                     $resp = $this->Aliyunsms->sendSms($notices_log['mobile'],$this->setting['template_codes'][3],$sms_content);
                     if($resp['Code'] == 'OK'){
                         $notices_log['status'] = "1";
+                        $info['sms_code'] = "OK";
                     }else{
                         $notices_log['status'] = "0";
                         $info['sms_msg'] = $resp['Message'];
@@ -522,9 +523,9 @@ class Notices{
             }elseif($this->setting['sms_type'] == '20' ){
                 $sms_content = array(
                     "workorder_id"=>$workorder['workorder_id'],
-                    "workorder_name"=>strlen($workorder['workorder_name'])<=18?$workorder['workorder_name']:substr($workorder['workorder_name'],0,18)."..",
+                    "workorder_name"=>mb_strlen($workorder['workorder_name'],'utf-8')<=18?$workorder['workorder_name']:mb_substr($workorder['workorder_name'],0,18,'utf-8')."..",
                     "workorder_type"=>$workorder['type'],
-                    "remark_content"=>strlen($workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content'])<=18?$workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content']:substr($workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content'],0,18).".."
+                    "remark_content"=>mb_strlen($workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content'],'utf-8')<=18?$workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content']:mb_substr($workorder['remark_list'][count($workorder['remark_list'])-1]['remark_content'],0,18,'utf-8').".."
                 );
                 $resp = $this->Aliyunsms->sendSms($receive_user['mobile'],$this->setting['template_codes'][4],$sms_content);
                 if($resp['Code'] == 'OK'){
@@ -617,10 +618,10 @@ class Notices{
             }elseif($this->setting['sms_type'] == '20' ){
                 $sms_content = array(
                     "workorder_id"=>$workorder['workorder_id'],
-                    "workorder_name"=>strlen($workorder['workorder_name'])<=18?$workorder['workorder_name']:substr($workorder['workorder_name'],0,18)."..",
+                    "workorder_name"=>mb_strlen($workorder['workorder_name'],'utf-8')<=18?$workorder['workorder_name']:mb_substr($workorder['workorder_name'],0,18,'utf-8')."..",
                     "workorder_type"=>$workorder['type']
                 );
-                $resp = $this->Aliyunsms->sendSms($receive_user['mobile'],$this->setting['template_codes'][4],$sms_content);
+                $resp = $this->Aliyunsms->sendSms($receive_user['mobile'],$this->setting['template_codes'][5],$sms_content);
                 if($resp['Code'] == 'OK'){
                     $notices_log['status'] = "1";
                     $info['sms_code'] = "OK";

+ 3 - 3
application/views/templates/appauth/index.html

@@ -52,7 +52,7 @@
                         </select>
                     </div>
                     <div class="form-group">
-                        <input class="form-control keyword" name="keyword" id="keyword" placeholder="筛选" type="text" value="{$keyword}">
+                        <input class="form-control keyword" name="keyword" id="keyword" placeholder="搜索" type="text" value="{$keyword}">
                         <button type="submit" class="search">
                             <i class="glyphicon glyphicon-search"></i>
                         </button>
@@ -151,13 +151,13 @@
         layer.config({
             extend: 'myskin/style.css', //加载新皮肤
         });
-        $("#keyword").on('input',function () {
+        /*$("#keyword").on('input',function () {
             $('#data_table').bootstrapTable('resetSearch', $(this).val());
             $('input').iCheck({
                 cursor : true,
                 checkboxClass : 'icheckbox_square-blue'
             });
-        });
+        });*/
         $("#add_appauth").click(function () {
             parent.$('#mainFrameTabs').bTabsAdd("tab21","新增接入授权","appauth/add");
         })

+ 3 - 3
application/views/templates/user/index.html

@@ -62,7 +62,7 @@
                         </select>
                     </div>
                     <div class="form-group">
-                        <input class="form-control keyword" name="keyword" id="keyword" placeholder="筛选" type="text" value="{$keyword}">
+                        <input class="form-control keyword" name="keyword" id="keyword" placeholder="搜索" type="text" value="{$keyword}">
                         <button type="submit" class="search">
                             <i class="glyphicon glyphicon-search"></i>
                         </button>
@@ -176,13 +176,13 @@
         layer.config({
             extend: 'myskin/style.css', //加载新皮肤
         });
-        $("#keyword").on('input',function () {
+        /*$("#keyword").on('input',function () {
             $('#data_table').bootstrapTable('resetSearch', $(this).val());
             $('input').iCheck({
                 cursor : true,
                 checkboxClass : 'icheckbox_square-blue'
             });
-        });
+        });*/
         $("select").select2({minimumResultsForSearch: -1});
         $("#add_user").click(function () {
             parent.$('#mainFrameTabs').bTabsAdd("tab11","新增帐号","user/add");

+ 4 - 4
application/views/templates/warning/ignoreindex.html

@@ -38,7 +38,7 @@
                         </select>
                     </div>
                     <div class="form-group">
-                        <input class="form-control keyword" name="warning_name" id="warning_name" placeholder="筛选" type="text" value="{$warning_name}">
+                        <input class="form-control keyword" name="warning_name" id="warning_name" placeholder="搜索" type="text" value="{$warning_name}">
                         <button type="submit" class="search">
                             <i class="glyphicon glyphicon-search"></i>
                         </button>
@@ -67,7 +67,7 @@
                 <td class="text-center"><span class="level level{{$val['level']}}">{$warning_level[$val['level']]}</span></td> <!--已失陷、高可疑、高危、中危、低危-->
                 <td data-searchable="true">{if array_key_exists($val['branch']['branch_id'],$branch)}{$branch[$val['branch']['branch_id']]['branch_name']}{else}未配置分支{/if}</td>
                 <td class="col-xs-2"><div class="text_over" style="width: 260px;">{$val['content']}</div></td>
-                <td class="text-center">{$val['create_time']->toDateTime()|date_format:'%Y-%m-%d %H:%M:%S'}</td>
+                <td class="text-center">{if array_key_exists('record_time',$val)}{$val['record_time']|date_format:'%Y-%m-%d %H:%M:%S'}{/if}</td>
                 <td class="text-center"><span class="w_status{$val['status']}">{$warning_status[$val['status']]}</span></td> <!--待审核下发、已忽略-->
                 <td class="text-center">
                     <a href="javascript:;" data-id="{$val['warning_id']}" class="view_info">
@@ -116,9 +116,9 @@
         $("select").select2({
             minimumResultsForSearch: -1
         });
-        $("#warning_name").on('input',function () {
+        /*$("#warning_name").on('input',function () {
             $('#data_table').bootstrapTable('resetSearch', $(this).val());
-        });
+        });*/
         $("#page_size").change(function () {
             var page_size = $(this).val();
             window.location.href = "warning/ignoreindex?page_size="+page_size;

+ 4 - 4
application/views/templates/warning/index.html

@@ -65,7 +65,7 @@
                             </select>
                         </div>
                         <div class="form-group">
-                            <input class="form-control keyword" name="warning_name" id="warning_name" placeholder="筛选" type="text" value="{$warning_name}">
+                            <input class="form-control keyword" name="warning_name" id="warning_name" placeholder="搜索" type="text" value="{$warning_name}">
                             <button type="submit" class="search">
                                 <i class="glyphicon glyphicon-search"></i>
                             </button>
@@ -97,7 +97,7 @@
                         <td class="text-center"><span class="level level{{$val['level']}}">{$warning_level[$val['level']]}</span></td> <!--已失陷、高可疑、高危、中危、低危-->
                         <td data-searchable="true">{if array_key_exists($val['branch']['branch_id'],$branch)}{$branch[$val['branch']['branch_id']]['branch_name']}{else}未配置分支{/if}</td>
                         <td class="col-xs-2"><div class="text_over" style="width: 260px;">{$val['content']}</div></td>
-                        <td class="text-center">{$val['create_time']->toDateTime()|date_format:'%Y-%m-%d %H:%M:%S'}</td>
+                        <td class="text-center">{if array_key_exists('record_time',$val)}{$val['record_time']|date_format:'%Y-%m-%d %H:%M:%S'}{/if}</td>
                         <td class="text-center"><span class="w_status{$val['status']}">{$warning_status[$val['status']]}</span></td> <!--待审核下发、已忽略-->
                         <td class="text-left">
                             <!--a href="{$val['url']}" target="_blank">
@@ -170,13 +170,13 @@
             cursor : true,
             checkboxClass : 'icheckbox_square-blue'
         });
-        $("#warning_name").on('input',function () {
+        /*$("#warning_name").on('input',function () {
             $('#data_table').bootstrapTable('resetSearch', $(this).val());
             $('input').iCheck({
                 cursor : true,
                 checkboxClass : 'icheckbox_square-blue'
             });
-        });
+        });*/
         $("select").select2({minimumResultsForSearch: -1});
         $(".bootstrap-table").on('click',".view_info",function(){
             var id = $(this).data("id");

+ 3 - 3
application/views/templates/workorder/finished.html

@@ -41,7 +41,7 @@
                         </select>
                     </div>
                     <div class="form-group">
-                        <input class="form-control keyword" name="keyword" id="keyword" placeholder="筛选" type="text" value="{$keyword}">
+                        <input class="form-control keyword" name="keyword" id="keyword" placeholder="搜索" type="text" value="{$keyword}">
                         <button type="submit" class="search">
                             <i class="glyphicon glyphicon-search"></i>
                         </button>
@@ -131,9 +131,9 @@
         layer.config({
             extend: 'myskin/style.css', //加载新皮肤
         });
-        $("#keyword").on('input',function () {
+        /*$("#keyword").on('input',function () {
             $('#data_table').bootstrapTable('resetSearch', $(this).val());
-        });
+        });*/
         $("select").select2({
             minimumResultsForSearch: -1
         });

+ 34 - 9
application/views/templates/workorder/index.html

@@ -55,7 +55,7 @@
                         </select>
                     </div>
                     <div class="form-group">
-                        <input class="form-control keyword" name="keyword" id="keyword" placeholder="筛选" type="text" value="{$keyword}">
+                        <input class="form-control keyword" name="keyword" id="keyword" placeholder="搜索" type="text" value="{$keyword}">
                         <button type="submit" class="search">
                             <i class="glyphicon glyphicon-search"></i>
                         </button>
@@ -82,7 +82,7 @@
             {foreach $workorder_list as $k=>$val}
             <tr>
                 <td data-searchable="true"> <a href="javascript:;" data-id="{$val['workorder_id']}" class="view_info">{$val['workorder_id']}</a></td>
-                <td data-searchable="true">{$val['workorder_name']}</td>
+                <td data-searchable="true"><div style="width:200px;">{$val['workorder_name']}</div></td>
                 <td class="text-center" data-searchable="true">{$val['type']}</td>
                 <td class="text-center" data-searchable="true">{if array_key_exists($val['branch']['branch_id'],$branch)}{$branch[$val['branch']['branch_id']]['branch_name']}{else}未配置分支{/if}</td>
                 <td>{foreach $val['send_type'] as $type}{$send_type[$type]}&nbsp;{/foreach}</td>
@@ -174,9 +174,9 @@
             extend: 'myskin/style.css', //加载新皮肤
         });
         $("select").select2({minimumResultsForSearch: -1});
-        $("#keyword").on('input',function () {
+        /*$("#keyword").on('input',function () {
             $('#data_table').bootstrapTable('resetSearch', $(this).val());
-        });
+        });*/
         $(".bootstrap-table").on('click',".delete",function () {
             var id = $(this).data("id");
             layer.confirm("确定要删除该工单吗?", {skin: 'layer-ext-myskin',icon: 3, title:'提示'}, function(index){
@@ -210,7 +210,12 @@
                                 window.location.reload();
                             })
                         }
-                    )
+                    ).error(function(xhr,errorText,errorType){
+                        layer.msg(errorType, {icon:2, time: 3000},function () {
+                            layer.close(loadindex);
+                            window.location.reload();
+                        });
+                    });
                 }else{
                     layer.alert("参数错误,请刷新后重试!",{skin: 'layer-ext-myskin',icon: 5, title:'错误提示'});
                 }
@@ -244,7 +249,12 @@
                                         window.location.reload();
                                     })
                                 }
-                            )
+                            ).error(function(xhr,errorText,errorType){
+                                layer.msg(errorType, {icon:2, time: 3000},function () {
+                                    layer.close(loadindex);
+                                    window.location.reload();
+                                });
+                            });
                         }
                     }
                 })
@@ -278,7 +288,12 @@
                                         window.location.reload();
                                     })
                                 }
-                            )
+                            ).error(function(xhr,errorText,errorType){
+                                layer.msg(errorType, {icon:2, time: 3000},function () {
+                                    layer.close(loadindex);
+                                    window.location.reload();
+                                });
+                            });
                         }
                     }
                 })
@@ -328,7 +343,12 @@
                                                     window.location.reload();
                                                 })
                                             }
-                                        )
+                                        ).error(function(xhr,errorText,errorType){
+                                            layer.msg(errorType, {icon:2, time: 3000},function () {
+                                                layer.close(loadindex);
+                                                window.location.reload();
+                                            });
+                                        });
                                     } else {
                                         layer.msg(data.error, {icon: 2});
                                     }
@@ -353,7 +373,12 @@
                                             window.location.reload();
                                         })
                                     }
-                                )
+                                ).error(function(xhr,errorText,errorType){
+                                    layer.msg(errorType, {icon:2, time: 3000},function () {
+                                        layer.close(loadindex);
+                                        window.location.reload();
+                                    });
+                                });
                             }
                         }
                     }

+ 4 - 1
static/css/style.css

@@ -595,7 +595,10 @@ fieldset{
 .panel>.panel-body+.table{
     table-layout: fixed;
 }
-
+.panel-body p{
+    word-wrap:break-word;
+    word-break:break-all;
+}
 .panel-body button{
     color: #000;
     border: none;