q 1 год назад
Родитель
Сommit
44a185d97f

+ 3 - 2
webmain/model/agent/agent.php

@@ -77,8 +77,8 @@ class agentModel extends Model
 			'wdtotal' 	=> 0,
 			'event'		=> $lx,
 			'num'		=> $num,
-			'rows'		=> array(),
-			'rowd'		=> array(),
+			'rows'		=> array(), // 列表
+			'rowd'		=> array(), // 详情
 			'page'		=> $page,
 			'limit'		=> $this->limit,
 			'agentid'	=> $this->agentid,
@@ -86,6 +86,7 @@ class agentModel extends Model
 			'maxpage'	=> 0
 		);
 		if(is_array($narr))foreach($narr as $k=>$v)$arr[$k]=$v;
+        // rows列表 rowd详情
 		$barr 			= $this->agentrows($arr['rows'],$arr['rowd'], $uid);
 		if(isset($barr['rows'])){
 			foreach($barr as $k=>$v)$arr[$k]=$v;

+ 4 - 68
webmain/model/agent/repair_faultModel.php

@@ -4,78 +4,14 @@
  */
 class agent_repair_faultClassModel extends agentModel
 {
+
     protected function agentrows($rows, $rowd, $uid){
         $typearr = array();
-        if($this->loadci==1) $typearr = $this->flowwesearchdata(1);
-        return array(
-            'rows' =>$rows, // 数据
-            'typearr' =>$typearr, // 类型数组
-        );
-    }
-
-    public function flowwesearchdata($lx)
-    {
-        $arr = m("repair_type")->getall("1=1", "*");
-        $getselectdatad = [];
-        foreach ($arr as $k => $rs) {
-            $dd['id'] = $rs['id'];
-            $dd['name'] = $rs['name'];
-            $dd['num'] = null;
-            $dd['value'] = null;
-            $dd['stotal'] = 0;
-            $dd['nameo'] = $rs['name'];
-            $dd['padding'] = 0;
-            $getselectdatad[] = $dd;
-        }
-        if($lx==1)return $getselectdatad;
+        if($this->loadci==1)$typearr = $this->flow->flowwesearchdata(1);
         return array(
-            'typename' => '所有分类',
-            'searchmsg' => '新闻标题/分类',
+            'rows' =>$rows,
+            'typearr' =>$typearr,
         );
     }
 
-//    public function getdata($uid, $num, $lx, $page)
-//    {
-//        $this->tongmode = true;
-//        if(!isempt($lx)){
-//            $lxa = explode('|', $lx);
-//            if(isset($lxa[1]) && !isempt($lxa[1])){
-//                if($lxa[1] != $num)$this->tongmode = false;
-//                $num = $lxa[1]; // repair_fault
-//                $lx  = $lxa[0]; // all
-//            }
-//        }
-//        $this->loadci 	= (int)$this->rock->get('loadci','0');
-//        $this->getagentinfor($num);
-//        $this->page 	= $page;
-//        $this->user_id 	= $uid;
-//        $this->event 	= $lx;
-//        $narr 	= $this->agentdata($uid, $lx);
-//        $lx		= $this->event; // all
-//        if(!$narr)$narr = $this->getdatalimit($uid, $lx);
-//
-//
-//        $arr 	= array(
-//            'wdtotal' 	=> 0,
-//            'event'		=> $lx,
-//            'num'		=> $num,
-//            'rows'		=> array(),
-//            'rowd'		=> array(),
-//            'page'		=> $page,
-//            'limit'		=> $this->limit,
-//            'agentid'	=> $this->agentid,
-//            'count'		=> 0,
-//            'maxpage'	=> 0
-//        );
-//        if(is_array($narr))foreach($narr as $k=>$v)$arr[$k]=$v;
-//        $barr 			= $this->agentrows($arr['rows'],$arr['rowd'], $uid);
-//        if(isset($barr['rows'])){
-//            foreach($barr as $k=>$v)$arr[$k]=$v;
-//            $barr = $barr['rows'];
-//        }
-//        $arr['rows'] 	= $this->showrowsface($barr);
-//        $arr['stotal']	= $this->agenttotals($uid);
-//        unset($arr['rowd']);
-//        return $arr;
-//    }
 }

+ 13 - 0
webmain/model/flow/repair_faultModel.php

@@ -55,6 +55,8 @@ class flow_repair_faultClassModel extends flowModel
 
     //提交时调用
     protected function flowsubmit($na, $sm){
+//        if ($na != '编辑') {
+//        }
         $row = m("repair_fault")->getone("id={$this->id}");
         if (!empty($row) && $row['handle_state'] == 0 && $row['sms_state'] == 0) {
             $typeInfo = m("repair_type")->getone("id={$row['type_id']}");
@@ -67,6 +69,17 @@ class flow_repair_faultClassModel extends flowModel
         }
     }
 
+    public function flowwesearchdata($lx)
+    {
+        $pid = m("repair_type")->type_pid;
+        if($lx==1)return $this->option->getselectdata($pid, true);
+        return array(
+            'typename' => '所有分类',
+            'searchmsg' => '标题/分类',
+        );
+    }
+
+
     public function getstatezt($zt)
     {
         $colors = ["#ff8b1a", "#00c959", "#ff4974"];

+ 39 - 0
webmain/model/flow/repair_typeModel.php

@@ -0,0 +1,39 @@
+<?php
+
+class flow_repair_typeClassModel extends flowModel
+{
+
+    public $type_pid;
+
+    protected function flowinit(){
+        $this->type_pid = m('repair_type')->type_pid;
+    }
+
+    //删除单据时调用
+    public function flowdeletebill($sm) {
+//        $optId = $this->rs['option_id'];
+//        m('option')->delete("id = $optId");
+    }
+
+    //提交时调用
+    protected function flowsubmit($na, $sm) {
+        if ($na == '编辑') {
+//            if (empty($this->id)) return;
+//            $name = $this->rs['name'];
+//            $pid = $this->rs['option_id'];
+//            if (empty($pid)) {
+//                $res = m('option')->insert(["name"=>$name,  "pid"=>$this->type_pid, "explain"=>"自动生成"]);
+//                $this->update(['option_id'=>$res], "id = $this->id");
+//            } else {
+//                m('option')->update(["name"=>$name, "pid"=>$this->type_pid], "id=$pid");
+//            }
+        } else {
+//            $name = $this->rs['name'];
+//            $res = m('option')->insert(["name"=>$name, "pid"=>$this->type_pid, "explain"=>"自动生成"]);
+//            $this->update(['option_id'=>$res], "id = $this->id");
+        }
+
+    }
+
+
+}

+ 17 - 0
webmain/model/repair_faultModel.php

@@ -2,9 +2,26 @@
 
 class repair_faultClassModel extends Model
 {
+    public $repair_type;
 
     public function initModel()
     {
+//        $this->repair_type = $this->getType();
+    }
+
+    public function getType() {
+//        $typePid = m("option")->getone("num='repair_type'", 'id');
+//        $typeArr = m("option")->getall("pid=".$typePid['id']);
+//
+//        for ($i = 0; $i < count($typeArr); $i++) {
+//            $list = $typeArr[$i];
+//            $arr[] = [
+//                "name" => $list['name'],
+//                "value" => $list['id'],
+//                "subname" => $list['id'],
+//            ];
+//        }
+//        return $arr;
     }
 
     public function typeList()

+ 12 - 0
webmain/model/repair_typeModel.php

@@ -0,0 +1,12 @@
+<?php
+
+class repair_typeClassModel extends Model
+{
+    public $type_pid;
+
+    public function initModel()
+    {
+        $this->type_pid = m('option')->getmou('id', "num='repair_type'");
+    }
+
+}

+ 14 - 13
webmain/we/ying/yingyong/repair_fault.js

@@ -1,13 +1,14 @@
-function myyingsinit(){
-    var s = '<select id="type_id" style="width:100px;border:none;background:white;font-size:14px"><option value="">所有分类</option></select>';
-    $('#searsearch_bar').prepend(s);
-    $('#type_id').change(function(){
-        yy.search({'type_id':this.value});
-    });
-}
-yy.onshowdata=function(da){
-    if(da.typearr){
-        js.setselectdata(get('type_id'), da.typearr, 'id');
-    }
-}
-myyingsinit();
+// function myyingsinit(){
+//     var s = '<select id="type_id" style="width:100px;border:none;background:white;font-size:14px"><option value="">所有分类</option></select>';
+//     $('#searsearch_bar').prepend(s);
+//     $('#type_id').change(function(){
+//         yy.search({'type_id':this.value});
+//     });
+// }
+// // 生成下拉选项
+// yy.onshowdata=function(da){
+//     if(da.typearr){
+//         js.setselectdata(get('type_id'), da.typearr, 'id');
+//     }
+// }
+// myyingsinit();