zhanglinxin 1 anno fa
parent
commit
67e6ea1484

+ 1 - 1
application/approve/controller/ApproveInfo.php

@@ -129,7 +129,7 @@ class ApproveInfo extends Controller
         $data = ApproveInfoService::get_detail($id, [], CommonConstant::IS_WHO_0, 'detail');
         if ($data) {
             // 维修人员
-            $data['maintain_user'] = $data['module'] == CommonConstant::MODULE_8 && $data['maintain_user_id'] > 0 ? ApproveMaintainUser::find($data['maintain_user_id']) :null;
+            $data['maintain_user'] = $data['module'] == CommonConstant::MODULE_8 && $data['maintain_user_id'] > 0 ? ApproveMaintainUser::field('id,name')->find($data['maintain_user_id']) :null;
 
             $this->title = $this->get_module_list[$data['module']] . '详情';
             $this->get_type_list = CommonService::get_type_list($data['module']);

+ 1 - 1
application/common.php

@@ -520,7 +520,7 @@ function get_stay_time($remain_time, $is_hour = 1, $is_minutes = 1)
         }
         return $day;
     }
-    return '1分钟';
+    return $remain_time.'秒';
 
 }
 

+ 4 - 6
application/common/service/ApproveInfoService.php

@@ -182,12 +182,10 @@ class ApproveInfoService
             }
         }
 
-        if ($way == CommonConstant::create) {
-            // 9=合同呈批申请 生成合同编号
-            if ($module == CommonConstant::MODULE_9) {
-                $contract_no = CommonService::get_contract_no($params['type']);
-                $info->save(['reason' => $contract_no]);
-            }
+        // 9=合同呈批申请 提交 生成合同编号
+        if ($module == CommonConstant::MODULE_9 && $way == CommonConstant::create) {
+            $contract_no = CommonService::get_contract_no($params['type']);
+            $info->save(['reason' => $contract_no]);
         }
 
         return true;

+ 7 - 9
application/common/service/ApproveService.php

@@ -479,14 +479,14 @@ class ApproveService
 
         if ($status == CommonConstant::STATUS_3) {
             if ($info->module == CommonConstant::MODULE_3) {
-                // 入库商品列表
+                // 3=入库申请
                 $goods = $info->stock_goods;
                 if (!$goods->toArray()) {
                     except('入库商品不存在');
                 }
             }
             if ($info->module == CommonConstant::MODULE_8) {
-                // 维修
+                // 8=维修申请
                 $is_maintain = CommonService::isMaintain($user);
                 if ($is_maintain && !$maintain_user_id) {
                     except('请选择维修人员');
@@ -497,13 +497,11 @@ class ApproveService
                 }
             }
         }
-        if ($status == CommonConstant::STATUS_4) {
-            if ($info->module == CommonConstant::MODULE_4) {
-                // 领用商品列表 TODO
-                $goods = $info->use_goods;
-                if (!$goods->toArray()) {
-                    except('领用商品不存在');
-                }
+        if ($info->module == CommonConstant::MODULE_4) {
+            // 4=领用申请
+            $goods = $info->use_goods;
+            if (!$goods->toArray()) {
+                except('领用商品不存在');
             }
         }