hzd 3 ay önce
ebeveyn
işleme
6f0820d9b3

+ 5 - 1
application/admin/view/common/select3.html

@@ -64,7 +64,11 @@
                 $.post('{$url}',{id:newVal},function (res) {
                     that.options1 = res.data;
                     that.value1 = [];
-
+                    if(that.options1.length > 0){
+                        for(let o in that.options1){
+                            that.value1.push(that.options1[o].id.toString());
+                        }
+                    }
                 })
                 $('input[name={$name}]').val(newVal);
             },

+ 8 - 5
application/admin/view/orders/dispatch_add3.html

@@ -340,6 +340,7 @@
     }
     $(document).ready(function(){
         formSetValue("back", {$info.back|default=0});
+        $("#yy").css('display','block');
     });
     $('#patient').hide();
     var vdevices = {:json_encode($order_device)};
@@ -413,12 +414,14 @@
                         this.devices = vdevices;
                         $('#patient').hide();
                     }
-                        if(item.cate==4){
-                            $("#yy").css('display','block')
-                        }else {
-                            $("#yy").css('display','none')
 
-                        }
+                        $("#yy").css('display','block')
+                        // if(item.cate==4){
+                        //     $("#yy").css('display','block')
+                        // }else {
+                        //     $("#yy").css('display','none')
+                        //
+                        // }
                 }
             });
             },

+ 8 - 5
application/admin/view/orders/self_add3.html

@@ -237,6 +237,7 @@
 <script>
     $(document).ready(function(){
         formSetValue("back", {$info.back|default=0});
+        $("#yy").css('display','block')
     });
     $('#patient').hide();
     var vdevices = {:json_encode($order_device)};
@@ -305,12 +306,14 @@
                         this.devices = vdevices;
                         $('#patient').hide();
                     }
-                    if(item.cate==4){
-                        $("#yy").css('display','block')
-                    }else {
-                        $("#yy").css('display','none')
 
-                    }
+                        $("#yy").css('display','block')
+                    // if(item.cate==4){
+                    //     $("#yy").css('display','block')
+                    // }else {
+                    //     $("#yy").css('display','none')
+                    //
+                    // }
                 }
 
             });

+ 42 - 0
application/index/controller/Index.php

@@ -2,6 +2,7 @@
 namespace app\index\controller;
 
 use app\common\util\AppMsg;
+use app\common\util\ExcelUtil;
 use app\hander\HelpHander;
 use EasyWeChat\Factory;
 use PhpOffice\PhpSpreadsheet\Spreadsheet;
@@ -17,6 +18,47 @@ class Index extends Controller
 //        $this->model = new \app\common\model\Daily();
     }
 
+    public function device(){
+        set_time_limit(0);
+        ini_set("memory_limit","512M");
+
+        $file = "./1.xls";
+        $orgId = 100;
+        $cate1 = 22; //灭火器
+        $cate2 = 23; // 消火栓
+        $form1 = "20,21,22,23";
+        $form2 = "24,25,26,27";
+
+        $userId = 3139;
+
+        $data = ExcelUtil::read($file,['title','sn','area','cate_id','content']);
+        $i = 0;
+        foreach ($data as $k=>$v){
+            if($i >= 906){
+                $data[$k]['org_id'] = $orgId;
+                $data[$k]['enable'] = 1;
+                if($v['cate_id'] == "灭火器"){
+                    $data[$k]['cate_id'] = $cate1;
+                    $data[$k]['device_form'] = $form1;
+                }else{
+                    $data[$k]['cate_id'] = $cate2;
+                    $data[$k]['device_form'] = $form2;
+                }
+
+                $deivceId = Db::name('device')->insertGetId($data[$k]);
+                if($deivceId){
+                    Db::name('device_user')->insert([
+                        "device_id" => $deivceId,
+                        "user_id" => $userId,
+                    ]);
+                }
+            }
+
+            $i++;
+        }
+        halt($data);
+    }
+
     public function tt(){
         $orgId = 28;
         $mode = 3;