ss há 4 meses atrás
pai
commit
8d4e22c937

+ 48 - 48
application/admin/controller/Todo.php

@@ -502,11 +502,11 @@ class Todo extends Auth
                     ->setCellValue('T1', '所在科室/部门')
                     ->setCellValue('U1', '来源')
                     ->setCellValue('V1', '部门分类')
-                    ->setCellValue('W1', '签名图')
-                    ->setCellValue('X1', '物品名称')
-                    ->setCellValue('Y1', '单价')
-                    ->setCellValue('Z1', '数量')
-                    ->setCellValue('AA1', '总价');
+                    ->setCellValue('W1', '物品名称')
+                    ->setCellValue('X1', '单价')
+                    ->setCellValue('Y1', '数量')
+                    ->setCellValue('Z1', '总价')
+                    ->setCellValue('AA1', '签名图');
             }
             else {
                 if ($mode == 3) {
@@ -644,55 +644,55 @@ class Todo extends Auth
                     $objPHPExcel->getActiveSheet()->setCellValue('U' . ($i + 2), $lists[$i]['source_type_text']);
                     $objPHPExcel->getActiveSheet()->setCellValue('V' . ($i + 2), $lists[$i]['dep_cate_name']);
 
-                    $signList = explode(".",$lists[$i]['sign']);
-                    if($signList){
-                        $ext = end($signList);
-                        $img ='';
-                        if ($ext == 'jpg' || $ext == 'jpeg'){
-                            $img = @imagecreatefromjpeg($lists[$i]['sign']);
-                        }
-                        if ($ext == 'png'){
-                            $img = @imagecreatefrompng($lists[$i]['sign']);
-                        }
-                        if($img){
-                            //实例化图片操作类
-                            $objDrawing = new \PHPExcel_Worksheet_MemoryDrawing();
-                            $objDrawing->setImageResource($img);
-                            $objDrawing->setRenderingFunction(\PHPExcel_Worksheet_MemoryDrawing::RENDERING_DEFAULT);//渲染方法
-
-                            $objDrawing->setMimeType(\PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT);
-
-                            $objDrawing->setHeight(40);//照片高度
-                            $objDrawing->setWidth(40); //照片宽度
-                            $objDrawing->setCoordinates('W'.($i+2));//图片要插入的单元格
-
-                            $objDrawing->setOffsetX(8);//图片X轴偏移
-                            $objDrawing->setOffsetY(8);//图片Y轴偏移
-                            $objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
-                            //设置每一行高度
-
-                        }else{
-                            $objPHPExcel->getActiveSheet()->setCellValue('W' . ($i + 2), '');
-                        }
-
-
-                    }else{
-                        $objPHPExcel->getActiveSheet()->setCellValue('W' . ($i + 2), '');
-                    }
-                    $objActSheet->getRowDimension($i + 2)->setRowHeight(40); // 行高
+//                    $signList = explode(".",$lists[$i]['sign']);
+//                    if($signList){
+//                        $ext = end($signList);
+//                        $img ='';
+//                        if ($ext == 'jpg' || $ext == 'jpeg'){
+//                            $img = @imagecreatefromjpeg($lists[$i]['sign']);
+//                        }
+//                        if ($ext == 'png'){
+//                            $img = @imagecreatefrompng($lists[$i]['sign']);
+//                        }
+//                        if($img){
+//                            //实例化图片操作类
+//                            $objDrawing = new \PHPExcel_Worksheet_MemoryDrawing();
+//                            $objDrawing->setImageResource($img);
+//                            $objDrawing->setRenderingFunction(\PHPExcel_Worksheet_MemoryDrawing::RENDERING_DEFAULT);//渲染方法
+//
+//                            $objDrawing->setMimeType(\PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT);
+//
+//                            $objDrawing->setHeight(40);//照片高度
+//                            $objDrawing->setWidth(40); //照片宽度
+//                            $objDrawing->setCoordinates('W'.($i+2));//图片要插入的单元格
+//
+//                            $objDrawing->setOffsetX(8);//图片X轴偏移
+//                            $objDrawing->setOffsetY(8);//图片Y轴偏移
+//                            $objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
+//                            //设置每一行高度
+//
+//                        }else{
+//                            $objPHPExcel->getActiveSheet()->setCellValue('W' . ($i + 2), '');
+//                        }
+//
+//
+//                    }else{
+//                        $objPHPExcel->getActiveSheet()->setCellValue('W' . ($i + 2), '');
+//                    }
+//                    $objActSheet->getRowDimension($i + 2)->setRowHeight(40); // 行高
 
 
                     $goodsName = $goodsPrice = $goodsNum = $goodsTotal  = '';
                     if(empty($lists[$i]['cons'])){
+                        $objPHPExcel->getActiveSheet()->setCellValue('W' . ($i + 2), "");
                         $objPHPExcel->getActiveSheet()->setCellValue('X' . ($i + 2), "");
                         $objPHPExcel->getActiveSheet()->setCellValue('Y' . ($i + 2), "");
                         $objPHPExcel->getActiveSheet()->setCellValue('Z' . ($i + 2), "");
-                        $objPHPExcel->getActiveSheet()->setCellValue('AA' . ($i + 2), "");
                     }else{
+                        $objPHPExcel->getActiveSheet()->getStyle('W'.($i + 2))->getAlignment()->setWrapText(true);
                         $objPHPExcel->getActiveSheet()->getStyle('X'.($i + 2))->getAlignment()->setWrapText(true);
                         $objPHPExcel->getActiveSheet()->getStyle('Y'.($i + 2))->getAlignment()->setWrapText(true);
                         $objPHPExcel->getActiveSheet()->getStyle('Z'.($i + 2))->getAlignment()->setWrapText(true);
-                        $objPHPExcel->getActiveSheet()->getStyle('AA'.($i + 2))->getAlignment()->setWrapText(true);
 
                         foreach ($lists[$i]['cons'] as $kk=>$vv){
                             $goodsName.= $vv['title']."\r\n";
@@ -700,12 +700,12 @@ class Todo extends Auth
                             $goodsNum.= $vv['money']."\r\n";
                             $goodsTotal.= $vv['total_money']."\r\n";
                         }
-                        $objPHPExcel->getActiveSheet()->setCellValue('X' . ($i + 2), $goodsName);
-                        $objPHPExcel->getActiveSheet()->setCellValue('Y' . ($i + 2), $goodsPrice);
-                        $objPHPExcel->getActiveSheet()->setCellValue('Z' . ($i + 2), $goodsNum);
-                        $objPHPExcel->getActiveSheet()->setCellValue('AA' . ($i + 2), $goodsTotal);
+                        $objPHPExcel->getActiveSheet()->setCellValue('W' . ($i + 2), $goodsName);
+                        $objPHPExcel->getActiveSheet()->setCellValue('X' . ($i + 2), $goodsPrice);
+                        $objPHPExcel->getActiveSheet()->setCellValue('Y' . ($i + 2), $goodsNum);
+                        $objPHPExcel->getActiveSheet()->setCellValue('Z' . ($i + 2), $goodsTotal);
                     }
-
+                    $objPHPExcel->getActiveSheet()->setCellValue('AA' . ($i + 2), $lists[$i]['sign']);
                 }
             }
             else {

+ 9 - 3
application/api/controller/v1/WasteRecord.php

@@ -302,15 +302,21 @@ class WasteRecord extends Base
             HelpHander::error('重量不能为空');
         }
 
-
+        $type = Db::name('waste_type')->where('id',$data['cateid'])->find();
+        if(!$type){
+            HelpHander::error('类型不存在');
+        }
+        if($type['type'] == 0){
+            $data['num'] = 0;
+        }
 
         if(!$data['create_time']){
             HelpHander::error('未选择收取时间');
         }
 
-        $waste_record_id = model('WsateRecord')->saverecord($data);
+        $waste_record_id = model('WasteRecord')->saverecord($data);
         if(!$waste_record_id){
-            HelpHander::error(model('WsateRecord')->getError());
+            HelpHander::error(model('WasteRecord')->getError());
         }
 
         HelpHander::success([],'操作成功');

+ 1 - 1
application/common/model/CleanPlanRecord.php

@@ -183,7 +183,7 @@ class CleanPlanRecord extends Base {
             ->join('clean_plan_record b','a.record_id = b.id')
             ->where($map)
             ->order('b.id desc')
-            ->field('b.id,b.address_id,b.form_id,b.enable,b.start,b.end')
+            ->field('b.id,b.address_id,b.form_id,b.enable,b.start,b.end,b.remark')
             ->page($page, $size)
             ->select();
         $lists = $lists?$lists:[];