zhanglinxin 1 tahun lalu
induk
melakukan
69e92f1502

+ 59 - 6
application/api/controller/Common.php

@@ -2,8 +2,12 @@
 
 namespace app\api\controller;
 
+use app\common\constant\ApplyConstant;
 use app\common\constant\CommonConstant;
+use app\common\constant\ContractConstant;
 use app\common\constant\EvectionConstant;
+use app\common\constant\LeaveConstant;
+use app\common\constant\MaintainConstant;
 use app\common\constant\OfferConstant;
 use hg\apidoc\annotation as Apidoc;
 
@@ -29,27 +33,46 @@ class Common extends Base
         $this->success('模块列表', get_one_two_array(CommonConstant::get_module_list(), 'id', 'name'));
     }
 
+    /**
+     * 缓急程度列表
+     *
+     * @Apidoc\Method("POST")
+     */
+    public function get_degree_list()
+    {
+        $this->success('缓急程度列表', get_one_two_array(OfferConstant::get_degree_list(), 'id', 'name'));
+    }
+
 
     /**
-     * 呈批类型列表
+     * 采购类型列表
      *
      * @Apidoc\Method("POST")
      */
-    public function get_offer_type_list()
+    public function get_apply_type_list()
     {
-        $this->success('呈批类型列表', get_one_two_array(OfferConstant::get_type_list(), 'id', 'name'));
+        $this->success('采购类型列表', get_one_two_array(ApplyConstant::get_type_list(), 'id', 'name'));
     }
 
     /**
-     * 呈批缓急程度列表
+     * 采购支付方式列表
      *
      * @Apidoc\Method("POST")
      */
-    public function get_offer_degree_list()
+    public function get_apply_pay_type_list()
     {
-        $this->success('呈批缓急程度列表', get_one_two_array(OfferConstant::get_degree_list(), 'id', 'name'));
+        $this->success('采购支付方式列表', get_one_two_array(ApplyConstant::get_pay_type_list(), 'id', 'name'));
     }
 
+    /**
+     * 呈批类型列表
+     *
+     * @Apidoc\Method("POST")
+     */
+    public function get_offer_type_list()
+    {
+        $this->success('呈批类型列表', get_one_two_array(OfferConstant::get_type_list(), 'id', 'name'));
+    }
 
     /**
      * 出差类型列表
@@ -61,4 +84,34 @@ class Common extends Base
         $this->success('出差类型列表', get_one_two_array(EvectionConstant::get_type_list(), 'id', 'name'));
     }
 
+    /**
+     * 请假类型列表
+     *
+     * @Apidoc\Method("POST")
+     */
+    public function get_leave_type_list()
+    {
+        $this->success('请假类型列表', get_one_two_array(LeaveConstant::get_type_list(), 'id', 'name'));
+    }
+
+    /**
+     * 维修类型列表
+     *
+     * @Apidoc\Method("POST")
+     */
+    public function get_maintain_type_list()
+    {
+        $this->success('维修类型列表', get_one_two_array(MaintainConstant::get_type_list(), 'id', 'name'));
+    }
+
+    /**
+     * 合同类型列表
+     *
+     * @Apidoc\Method("POST")
+     */
+    public function get_contract_type_list()
+    {
+        $this->success('合同类型列表', get_one_two_array(ContractConstant::get_type_list(), 'id', 'name'));
+    }
+
 }

+ 37 - 0
application/common/constant/ApplyConstant.php

@@ -0,0 +1,37 @@
+<?php
+
+namespace app\common\constant;
+
+/**
+ * 申购常量类
+ */
+class ApplyConstant
+{
+
+    // 采购类型:1=货物采购,2=工程采购,3=服务采购
+    const TYPE_1 = '1';
+    const TYPE_2 = '2';
+    const TYPE_3 = '3';
+
+    public static function get_type_list()
+    {
+        return [
+            self::TYPE_1 => '货物采购',
+            self::TYPE_2 => '工程采购',
+            self::TYPE_3 => '服务采购',
+        ];
+    }
+
+    // 支付方式:1=自行采购,2=学校采购
+    const PAY_TYPE_1 = '1';
+    const PAY_TYPE_2 = '2';
+
+    public static function get_pay_type_list()
+    {
+        return [
+            self::PAY_TYPE_1 => '自行采购',
+            self::PAY_TYPE_2 => '学校采购',
+        ];
+    }
+
+}

+ 1 - 0
application/common/constant/CommonConstant.php

@@ -160,4 +160,5 @@ class CommonConstant
             self::STATUS_5 => '审批撤销',
         ];
     }
+
 }

+ 35 - 0
application/common/constant/ContractConstant.php

@@ -0,0 +1,35 @@
+<?php
+
+namespace app\common\constant;
+
+/**
+ * 呈批常量类
+ */
+class ContractConstant
+{
+
+    // 合同类型:1=采购类01,2=收款类02,3=非经济类03
+    const TYPE_1 = '1';
+    const TYPE_2 = '2';
+    const TYPE_3 = '3';
+
+    public static function get_type_list()
+    {
+        return [
+            self::TYPE_1 => '采购类',
+            self::TYPE_2 => '收款类',
+            self::TYPE_3 => '非经济类',
+        ];
+    }
+
+    // 合同类型编码
+    public static function get_type_no_list()
+    {
+        return [
+            self::TYPE_1 => '01',
+            self::TYPE_2 => '02',
+            self::TYPE_3 => '03',
+        ];
+    }
+
+}

+ 4 - 4
application/common/constant/EvectionConstant.php

@@ -9,14 +9,14 @@ class EvectionConstant
 {
 
     // 出差类型:1=市内,2=市外
-    const EVECTION_TYPE_1 = '1';
-    const EVECTION_TYPE_2 = '2';
+    const TYPE_1 = '1';
+    const TYPE_2 = '2';
 
     public static function get_type_list()
     {
         return [
-            self::EVECTION_TYPE_1 => '市内出差',
-            self::EVECTION_TYPE_2 => '市外出差',
+            self::TYPE_1 => '市内出差',
+            self::TYPE_2 => '市外出差',
         ];
     }
 }

+ 46 - 0
application/common/constant/LeaveConstant.php

@@ -0,0 +1,46 @@
+<?php
+
+namespace app\common\constant;
+
+/**
+ * 请假常量类
+ */
+class LeaveConstant
+{
+
+    //请假类型:1=事假,2=病假,3=产假,4=婚假,5=陪产假,6=丧假,7=离深报批报备
+    const TYPE_1 = '1';
+    const TYPE_2 = '2';
+    const TYPE_3 = '3';
+    const TYPE_4 = '4';
+    const TYPE_5 = '5';
+    const TYPE_6 = '6';
+    const TYPE_7 = '7';
+
+    public static function get_type_list()
+    {
+        return [
+            self::TYPE_1 => '事假',
+            self::TYPE_2 => '病假',
+            self::TYPE_3 => '产假',
+            self::TYPE_4 => '婚假',
+            self::TYPE_5 => '陪产假',
+            self::TYPE_6 => '丧假',
+            self::TYPE_7 => '离深报批报备',
+        ];
+    }
+
+    // 请假周期 (用于审批流程)
+    const TIME_1 = '1';
+    const TIME_2 = '2';
+    const TIME_3 = '3';
+
+    public static function get_time_list()
+    {
+        return [
+            self::TIME_1 => '半天',
+            self::TIME_2 => '一天',
+            self::TIME_3 => '一天以上',
+        ];
+    }
+}

+ 23 - 0
application/common/constant/MaintainConstant.php

@@ -0,0 +1,23 @@
+<?php
+
+namespace app\common\constant;
+
+/**
+ * 维修常量类
+ */
+class MaintainConstant
+{
+
+    // 维修类型:1=物业维修,2=电教网络维修
+    const TYPE_1 = '1';
+    const TYPE_2 = '2';
+
+    public static function get_type_list()
+    {
+        return [
+            self::TYPE_1 => '物业维修',
+            self::TYPE_2 => '电教网络维修',
+        ];
+    }
+
+}

+ 10 - 10
application/common/constant/OfferConstant.php

@@ -9,28 +9,28 @@ class OfferConstant
 {
 
     // 呈批类型:1=采购类呈批,2=非采购类呈批
-    const OFFER_TYPE_1 = '1';
-    const OFFER_TYPE_2 = '2';
+    const TYPE_1 = '1';
+    const TYPE_2 = '2';
 
     public static function get_type_list()
     {
         return [
-            self::OFFER_TYPE_1 => '采购类呈批',
-            self::OFFER_TYPE_2 => '非采购类呈批',
+            self::TYPE_1 => '采购类呈批',
+            self::TYPE_2 => '非采购类呈批',
         ];
     }
 
     // 缓急程度:1=普通,2=紧急,3=特急
-    const OFFER_DEGREE_1 = '1';
-    const OFFER_DEGREE_2 = '2';
-    const OFFER_DEGREE_3 = '3';
+    const DEGREE_1 = '1';
+    const DEGREE_2 = '2';
+    const DEGREE_3 = '3';
 
     public static function get_degree_list()
     {
         return [
-            self::OFFER_DEGREE_1 => '普通',
-            self::OFFER_DEGREE_2 => '紧急',
-            self::OFFER_DEGREE_3 => '特急',
+            self::DEGREE_1 => '普通',
+            self::DEGREE_2 => '紧急',
+            self::DEGREE_3 => '特急',
         ];
     }
 }

+ 1 - 1
application/common/validate/ApproveUse.php

@@ -27,7 +27,7 @@ class ApproveUse extends Validate
     protected $scene = [
         'create' => ['reason','approve_user'],
         'update' => ['reason','approve_user'],
-        'edit' => ['reason',],
+        'edit' => ['reason'],
     ];
 
     /**

+ 2 - 2
config/database.php

@@ -19,8 +19,8 @@ return [
     // 数据库类型
     'type'        => 'mysql',
     // 服务器地址
-//    'hostname'    => '120.79.86.50',
-    'hostname'    => '127.0.0.1',
+    'hostname'    => '120.79.86.50',
+//    'hostname'    => '127.0.0.1',
     // 数据库名
     'database'    => 'dingding_hdlkeji',
     // 用户名