소스 검색

得润宝

cqp 1 주 전
부모
커밋
358dfab9fd

+ 12 - 1
app/Http/Controllers/Api/DingTalkController.php

@@ -35,7 +35,8 @@ class DingTalkController extends BaseController
     public function createProcessInstance(Request $request)
     {
         $service = new DrbService();
-        list($status,$data) = $service->createProcessInstance($request->all());
+        $userData = $request->userData;
+        list($status,$data) = $service->createProcessInstance($request->all(), $userData);
 
         if($status){
             return $this->json_return(200,'',$data);
@@ -44,5 +45,15 @@ class DingTalkController extends BaseController
         }
     }
 
+    public function getTemplateFields(Request $request)
+    {
+        $service = new DrbService();
+        list($status,$data) = $service->getTemplateFields($request->all());
 
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
 }

+ 2 - 2
app/Http/Controllers/Api/TableHeadController.php

@@ -10,7 +10,7 @@ class TableHeadController extends BaseController
     public function tableHeadAdd(Request $request)
     {
         $service = new TableHeadService();
-        $userData = $request->userData->toArray();
+        $userData = $request->userData;
         list($status,$data) = $service->tableheadAdd($request->all(),$userData);
 
         if($status){
@@ -23,7 +23,7 @@ class TableHeadController extends BaseController
     public function tableHeadGet(Request $request)
     {
         $service = new TableHeadService();
-        $userData = $request->userData->toArray();
+        $userData = $request->userData;
         list($status,$data) = $service->tableheadGet($request->all(),$userData);
 
         if($status){

+ 80 - 0
app/Http/Controllers/Api/U8Controller.php

@@ -22,4 +22,84 @@ class U8Controller extends BaseController
             return $this->json_return(201,$data);
         }
     }
+
+    public function purchaseRequisitionDetail(Request $request)
+    {
+        $userData = $request->userData;
+        $service = new U8ServerService($userData);
+        $error = $service->getError();
+        if(! empty($error)) return $this->json_return(201, $error);
+
+        list($status,$data) = $service->purchaseRequisitionDetail($request->all(),$userData);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function purchaseOrder(Request $request)
+    {
+        $userData = $request->userData;
+        $service = new U8ServerService($userData);
+        $error = $service->getError();
+        if(! empty($error)) return $this->json_return(201, $error);
+
+        list($status,$data) = $service->purchaseOrder($request->all(),$userData);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function purchaseOrderDetail(Request $request)
+    {
+        $userData = $request->userData;
+        $service = new U8ServerService($userData);
+        $error = $service->getError();
+        if(! empty($error)) return $this->json_return(201, $error);
+
+        list($status,$data) = $service->purchaseOrderDetail($request->all(),$userData);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function paymentOrder(Request $request)
+    {
+        $userData = $request->userData;
+        $service = new U8ServerService($userData);
+        $error = $service->getError();
+        if(! empty($error)) return $this->json_return(201, $error);
+
+        list($status,$data) = $service->paymentOrder($request->all(),$userData);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function paymentOrderDetail(Request $request)
+    {
+        $userData = $request->userData;
+        $service = new U8ServerService($userData);
+        $error = $service->getError();
+        if(! empty($error)) return $this->json_return(201, $error);
+
+        list($status,$data) = $service->paymentOrderDetail($request->all(),$userData);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
 }

+ 107 - 3
app/Service/DrbService.php

@@ -119,6 +119,8 @@ class DrbService extends Service
         [$success, $msg] = $this->createFlow($accessToken, $code, $userId, $userDetail, $formData);
         if(! $success) return [false, $msg];
 
+        //记录信息
+
         return [true, ''];
     }
 
@@ -158,11 +160,14 @@ class DrbService extends Service
 
     private function getModelCode($type){
         if($type == 1){
-            $code = "";
+            // 采购单
+            $code = "PROC-61E1D916-C7BE-4DE2-9D25-63505D8573B1";
         }elseif ($type == 2){
-            $code = "";
+            // 请购单
+            $code = "PROC-4FECC44D-993C-48E3-8623-CDC75B467622";
         }else{
-            $code = "";
+            // 付款单
+            $code = "PROC-F6D0C212-D8C6-4662-9AFD-EA9DE85A1F14";
         }
 
         return $code;
@@ -171,9 +176,108 @@ class DrbService extends Service
     private function getFormData($data){
         $model = [];
 
+        $formData = [
+            [
+                "name"  => "订单日期",
+                "value" => "2025-09-23" // 日期型字段,字符串 yyyy-MM-dd
+            ],
+            [
+                "name"  => "订单编号",
+                "value" => "PO20250923001"
+            ],
+            [
+                "name"  => "业务类型",
+                "value" => "标准采购"
+            ],
+            [
+                "name"  => "供应商",
+                "value" => "XX供应商有限公司"
+            ],
+            [
+                "name"  => "制单人",
+                "value" => "陈庆鹏"
+            ],
+            [
+                "name"  => "表格",
+                "value" => json_encode([
+                    [
+                        [
+                            "name"  => "存货名称",
+                            "value" => "打印机"
+                        ],
+                        [
+                            "name"  => "数量",
+                            "value" => "2"
+                        ],
+                        [
+                            "name"  => "主计量单位",
+                            "value" => "台"
+                        ],
+                        [
+                            "name"  => "原币价税合计",
+                            "value" => "3000"
+                        ]
+                    ],
+                    [
+                        [
+                            "name"  => "存货名称",
+                            "value" => "显示器"
+                        ],
+                        [
+                            "name"  => "数量",
+                            "value" => "5"
+                        ],
+                        [
+                            "name"  => "主计量单位",
+                            "value" => "个"
+                        ],
+                        [
+                            "name"  => "原币价税合计",
+                            "value" => "5000"
+                        ]
+                    ]
+                ], JSON_UNESCAPED_UNICODE) // 表格必须是字符串化的 JSON 数组
+            ]
+        ];
+
         return $model;
     }
 
+    private function recordDatabase($data, $user, $process_instance_id){
+
+    }
+
+    public function getTemplateFields($data)
+    {
+        $processCode = $data['code'] ?? "";
+        if (empty($processCode)) {
+            return [false, '模板编号 process_code 不能为空'];
+        }
+
+        [$ok, $tokenData] = $this->getAccessToken();
+        if (! $ok) return [false, $tokenData];
+        $accessToken = $tokenData['access_token'];
+
+        // 注意这里是 GET,并且 processCode 是 query 参数
+        $url = "https://api.dingtalk.com/v1.0/workflow/forms/schemas/processCodes?processCode={$processCode}";
+
+        $resp = $this->curlOpen1($url, [
+            'request' => 'get',
+            'header'  => [
+                "Content-Type: application/json",
+                "x-acs-dingtalk-access-token: {$accessToken}"
+            ],
+        ]);
+
+        $res = json_decode($resp, true);
+
+        if (isset($res['schemas'])) {
+            return [true, $res['schemas']];
+        } else {
+            return [false, $res];
+        }
+    }
+
     protected function curlOpen1($url, $config = [])
     {
         $default = [

+ 99 - 5
app/Service/U8ServerService.php

@@ -46,13 +46,107 @@ class U8ServerService extends Service
 
 
     public function purchaseRequisition($data, $user){
-        $model = $this->databaseService->table('DispatchList as a')
-            ->leftJoin('DispatchLists as b', 'b.DLID', 'a.DLID')
-            ->leftJoin('Inventory as c', 'c.cInvCode', 'b.cInvCode')
-            ->select('a.cDLCode as cdlcode', 'a.DLID as id', 'a.cCusName as customer_name', 'b.cSOCode as csocode', 'a.cDepCode as cdepcode', 'a.cCusCode as cuscode', 'a.dDate as date','b.irowno', 'b.iDLsID as idlsid', 'b.cWhCode as cwhcode', 'b.cInvCode as cinvcode', 'b.cInvName as product_title', 'b.cFree1 as cfree1', 'b.cFree2 as cfree2', 'b.cPosition as cposition', 'b.cBatch as cbatch', 'b.iQuantity as iquantity', 'b.iNum as inum', 'b.iInvExchRate as iinvexchrate', 'b.fOutQuantity as out_quantity', 'b.iUnitPrice as iunitcost', 'b.iMoney as imoney', 'b.cDefine28 as technology_material', 'b.cDefine30 as process_mark', 'c.cInvStd as product_size', DB::raw('(b.iQuantity - b.fOutQuantity) as quantity'), 'a.cMemo as table_header_mark', 'b.cMemo as table_body_mark');
+        $model = $this->databaseService->table('PU_AppVouch as a')
+            ->leftJoin('Person as c', 'c.cPersonCode', 'a.cPersonCode')
+            ->where('a.cMaker',$user['username'])
+            ->where('a.iverifystateex',0)
+            ->select('a.cMaker as crt_name', 'c.cPersonName as purchase_name','a.cBusType as business_type','a.cCode as order_number','a.dDate as order_date')
+            ->orderBy('a.ID','desc');
 
-       $list = $this->limit($model,'',$data);
+        $list = $this->limit($model,'',$data);
 
        return [true , $list];
     }
+
+    public function purchaseRequisitionDetail($data, $user){
+        if(empty($data['order_number'])) return [false, '采购请购单号不能为空'];
+
+        $order = $this->databaseService->table('PU_AppVouch as a')
+            ->leftJoin('Person as c', 'c.cPersonCode', 'a.cPersonCode')
+            ->where('a.cMaker',$user['username'])
+            ->select('a.cMaker as crt_name', 'c.cPersonName as purchase_name','a.cBusType as business_type','a.cCode as order_number','a.dDate as order_date','a.ID as id')
+            ->first();
+        if(empty($order)) return [false, '采购请购单不存在'];
+        $order = $order->toArray();
+
+        $detail = $this->databaseService->table('PU_AppVouchs as a')
+            ->leftJoin('Inventory as b', 'b.cInvCode', 'a.cInvCode')
+            ->leftJoin('ComputationUnit as c', 'c.cComunitCode', 'b.cComUnitCode')
+            ->where('a.ID', $order['id'])
+            ->select('b.cInvName as product_title','b.cInvCode as product_code','a.fQuantity as quantity','c.cComUnitName as unit_title','a.dRequirDate as need_arrived_date')
+            ->get()->toArray();
+        $order['detail'] = $detail;
+
+        return [true, $order];
+    }
+
+    public function purchaseOrder($data, $user){
+        $model = $this->databaseService->table('PO_Pomain as a')
+            ->leftJoin('Vendor as c', 'c.cVenCode', 'a.cVenCode')
+            ->where('a.cMaker',$user['username'])
+            ->where('a.iverifystateex',0)
+            ->select('a.cMaker as crt_name', 'a.cBusType as business_type','a.cPOID as order_number','a.dPODate as order_date','c.cVenName as supplier_title')
+            ->orderBy('a.POID','desc');
+
+        $list = $this->limit($model,'',$data);
+
+        return [true , $list];
+    }
+
+    public function purchaseOrderDetail($data, $user){
+        if(empty($data['order_number'])) return [false, '采购单号不能为空'];
+
+        $order = $this->databaseService->table('PO_Pomain as a')
+            ->leftJoin('Vendor as c', 'c.cVenCode', 'a.cVenCode')
+            ->where('a.cMaker',$user['username'])
+            ->where('a.iverifystateex',0)
+            ->select('a.cMaker as crt_name', 'a.cBusType as business_type','a.cPOID as order_number','a.dPODate as order_date','c.cVenName as supplier_title','a.POID as id')
+            ->first();
+        if(empty($order)) return [false, '采购单不存在'];
+        $order = $order->toArray();
+
+        $detail = $this->databaseService->table('PO_Podetails as a')
+            ->leftJoin('Inventory as b', 'b.cInvCode', 'a.cInvCode')
+            ->leftJoin('ComputationUnit as c', 'c.cComunitCode', 'b.cComUnitCode')
+            ->where('a.POID', $order['id'])
+            ->select('b.cInvName as product_title','b.cInvCode as product_code','a.iQuantity as quantity','c.cComUnitName as unit_title','a.iSum as amount')
+            ->get()->toArray();
+        $order['detail'] = $detail;
+
+        return [true, $order];
+    }
+
+    public function paymentOrder($data, $user){
+        $model = $this->databaseService->table('AP_ApplyPayVouch as a')
+            ->leftJoin('Vendor as c', 'c.cVenCode', 'a.cDwCode')
+            ->where('a.cOperator',$user['username'])
+            ->whereNull('a.cCheckMan')
+            ->select('a.cOperator as crt_name', 'c.cVenName as supplier_title','a.cVouchID as order_number','a.dVouchDate as order_date')
+            ->orderBy('a.PID','desc');
+
+        $list = $this->limit($model,'',$data);
+
+        return [true , $list];
+    }
+
+    public function paymentOrderDetail($data, $user){
+        if(empty($data['order_number'])) return [false, '付款单号不能为空'];
+
+        $order = $this->databaseService->table('AP_ApplyPayVouch as a')
+            ->leftJoin('Vendor as c', 'c.cVenCode', 'a.cDwCode')
+            ->where('a.cOperator',$user['username'])
+            ->whereNull('a.cCheckMan')
+            ->select('a.cOperator as crt_name', 'c.cVenName as supplier_title','a.cVouchID as order_number','a.dVouchDate as order_date','a.PID as id')
+            ->first();
+        if(empty($order)) return [false, '付款单不存在'];
+        $order = $order->toArray();
+
+        $detail = $this->databaseService->table('AP_ApplyPayVouchs as a')
+            ->where('a.PID', $order['id'])
+            ->select('a.cSource as source','a.cCoVouchID as source_order_number','a.iApplyAmt_f as amount')
+            ->get()->toArray();
+        $order['detail'] = $detail;
+
+        return [true, $order];
+    }
 }

+ 0 - 57
config/header/62.php

@@ -1,57 +0,0 @@
-<?php
-/**
- * '菜单ID' => [
- *     '字段英文名' =》 '字段中文名'
- * ]
- */
-
-return [
-    [
-        'key' =>'code',
-        'value' => '存货编码',
-    ],
-    [
-        'key' =>'title',
-        'value' => '存货名称',
-    ],
-    [
-        'key' =>'size',
-        'value' => '规格型号',
-    ],
-    [
-        'key' =>'category',
-        'value' => '所属类别',
-    ],
-    [
-        'key' =>'unit',
-        'value' => '计量单位',
-    ],
-    [
-        'key' =>'cost',
-        'value' => '成本单价',
-    ],
-    [
-        'key' =>'business_cost',
-        'value' => '业务成本单价',
-    ],
-    [
-        'key' =>'major_client_settlement_price',
-        'value' => '大客户结算单价',
-    ],
-    [
-        'key' =>'write_off_price',
-        'value' => '核销单价',
-    ],
-    [
-        'key' => 'return_change_price',
-        'value' => '退货损耗单价',
-    ],
-    [
-        'key' => 'freight_price',
-        'value' => '运费单价',
-    ],
-    [
-        'key' => 'mark',
-        'value' => '备注',
-    ],
-];

+ 0 - 21
config/header/63.php

@@ -1,21 +0,0 @@
-<?php
-/**
- * '菜单ID' => [
- *     '字段英文名' =》 '字段中文名'
- * ]
- */
-
-return [
-    [
-        'key' =>'code',
-        'value' => '编号',
-    ],
-    [
-        'key' =>'title',
-        'value' => '部门名称',
-    ],
-    [
-        'key' =>'is_use_title',
-        'value' => '是否启用状态',
-    ],
-];

+ 0 - 37
config/header/64.php

@@ -1,37 +0,0 @@
-<?php
-/**
- * '菜单ID' => [
- *     '字段英文名' =》 '字段中文名'
- * ]
- */
-
-return [
-    [
-        'key' =>'number',
-        'value' => '工号',
-    ],
-    [
-        'key' =>'emp_name',
-        'value' => '姓名',
-    ],
-    [
-        'key' =>'depart_title',
-        'value' => '部门',
-    ],
-    [
-        'key' =>'role_name',
-        'value' => '角色',
-    ],
-    [
-        'key' =>'mobile',
-        'value' => '联系方式',
-    ],
-    [
-        'key' =>'state_title',
-        'value' => '账号启用状态',
-    ],
-    [
-        'key' =>'is_admin_title',
-        'value' => '是否允许登录后台',
-    ],
-];

+ 0 - 17
config/header/65.php

@@ -1,17 +0,0 @@
-<?php
-/**
- * '菜单ID' => [
- *     '字段英文名' =》 '字段中文名'
- * ]
- */
-
-return [
-    [
-        'key' =>'title',
-        'value' => '角色名称',
-    ],
-    [
-        'key' =>'crt_time',
-        'value' => '创建时间',
-    ],
-];

+ 0 - 37
config/header/66.php

@@ -1,37 +0,0 @@
-<?php
-/**
- * '菜单ID' => [
- *     '字段英文名' =》 '字段中文名'
- * ]
- */
-
-return [
-    [
-        'key' =>'area',
-        'value' => '所属区域',
-    ],
-    [
-        'key' =>'region',
-        'value' => '地区',
-    ],
-    [
-        'key' =>'kilometer',
-        'value' => '公里数',
-    ],
-    [
-        'key' =>'min_freight_fee',
-        'value' => '最低运费',
-    ],
-    [
-        'key' =>'one_and_five',
-        'value' => '1-5吨',
-    ],
-    [
-        'key' =>'greater_than_five',
-        'value' => '5吨以上',
-    ],
-    [
-        'key' =>'company',
-        'value' => '物流公司',
-    ],
-];

+ 0 - 55
config/header/68.php

@@ -1,55 +0,0 @@
-<?php
-/**
- * '菜单ID' => [
- *     '字段英文名' =》 '字段中文名'
- * ]
- */
-
-return [
-    [
-        'key' =>'order_type_title',
-        'value' => '单据类型',
-    ],
-    [
-        'key' =>'order_time',
-        'value' => '统计年月',
-    ],
-    [
-        'key' =>'employee_id_1_title',
-        'value' => '业务员',
-    ],
-    [
-        'key' =>'income',
-        'value' => '收入金额',
-        'value1' => '销货单:含税金额;
-                     销售发票:开票金额;
-                     回款单:回款金额;',
-        'sum' => 1,
-    ],
-    [
-        'key' =>'adjust',
-        'value' => '调整金额',
-        'value1' => '金额为负数的合计',
-        'sum' => 1,
-    ],
-    [
-        'key' =>'business',
-        'value' => '业务成本金额',
-        'value1' => '业务成本金额合计',
-        'sum' => 1,
-    ],
-    [
-        'key' =>'profit',
-        'value' => '毛利',
-        'value1' => '收入金额 - 业务成本金额',
-        'sum' => 2,
-        'formula' => 'income - business',
-    ],
-    [
-        'key' =>'profit_rate',
-        'value' => '毛利率%',
-        'value1' => '毛利 / 收入金额',
-        'sum' => 2,
-        'formula' => 'profit / income * 100',
-    ],
-];

+ 0 - 118
config/header/69.php

@@ -1,118 +0,0 @@
-<?php
-/**
- * '菜单ID' => [
- *     '字段英文名' =》 '字段中文名'
- * ]
- */
-
-return [
-    [
-        'key' =>'order_number',
-        'value' => '销货单号',
-    ],
-    [
-        'key' =>'order_time',
-        'value' => '单据日期',
-    ],
-    [
-        'key' =>'employee_id_1_title',
-        'value' => '业务员',
-    ],
-    [
-        'key' =>'employee_id_2_title',
-        'value' => '上级管理人员',
-    ],
-    [
-        'key' =>'customer_code',
-        'value' => '结算客户编码',
-    ],
-    [
-        'key' =>'customer_title',
-        'value' => '结算客户',
-    ],
-    [
-        'key' =>'channel_finance',
-        'value' => '渠道财务',
-    ],
-    [
-        'key' =>'channel_details',
-        'value' => '渠道明细',
-    ],
-    [
-        'key' =>'product_code',
-        'value' => '存货编码',
-    ],
-    [
-        'key' =>'product_title',
-        'value' => '存货名称',
-    ],
-    [
-        'key' =>'product_size',
-        'value' => '规格型号',
-    ],
-    [
-        'key' =>'unit',
-        'value' => '单位',
-    ],
-    [
-        'key' =>'price_1',
-        'value' => '核销单价',
-        'value1' => '存货档案中的核销单价',
-    ],
-    [
-        'key' =>'price_1_total',
-        'value' => '核销总价',
-        'value1' => '核销单价 * 销货数量',
-        'sum' => 1,
-    ],
-    [
-        'key' =>'price_2',
-        'value' => '运费单价',
-        'value1' => '存货档案中的运费单价',
-    ],
-    [
-        'key' =>'price_2_total',
-        'value' => '运费总价',
-        'value1' => '运费单价 * 销货数量',
-        'sum' => 1,
-    ],
-    [
-        'key' =>'quantity',
-        'value' => '销货数量',
-        'sum' => 1,
-    ],
-    [
-        'key' =>'price_3',
-        'value' => '含税单价',
-    ],
-    [
-        'key' =>'price_3_total',
-        'value' => '含税金额',
-        'sum' => 1,
-    ],
-    [
-        'key' =>'price_4',
-        'value' => '业务成本单价',
-        'value1' => '存货档案中的业务成本单价',
-    ],
-    [
-        'key' =>'price_4_total',
-        'value' => '业务成本金额',
-        'value1' => '销货数量 * 业务成本单价',
-        'sum' => 1,
-    ],
-    [
-        'key' =>'profit',
-        'value' => '毛利',
-        'value1' => '销货金额(含税金额) - 业务成本金额',
-        'sum' => 2,
-        'formula' => 'price_3_total - business',
-    ],
-    [
-        'key' =>'profit_rate',
-        'value' => '毛利率%',
-        'value1' => '毛利 / 销货金额(含税金额)',
-        'sum' => 2,
-        'formula' => 'profit / price_3_total * 100',
-    ],
-];

+ 0 - 88
config/header/70.php

@@ -1,88 +0,0 @@
-<?php
-/**
- * '菜单ID' => [
- *     '字段英文名' =》 '字段中文名'
- * ]
- */
-
-return [
-    [
-        'key' =>'order_number',
-        'value' => '销售发票号',
-    ],
-    [
-        'key' =>'order_time',
-        'value' => '单据日期',
-    ],
-    [
-        'key' =>'employee_id_1_title',
-        'value' => '业务员',
-    ],
-    [
-        'key' =>'employee_id_2_title',
-        'value' => '上级管理人员',
-    ],
-    [
-        'key' =>'customer_code',
-        'value' => '结算客户编码',
-    ],
-    [
-        'key' =>'customer_title',
-        'value' => '结算客户',
-    ],
-    [
-        'key' =>'product_code',
-        'value' => '存货编码',
-    ],
-    [
-        'key' =>'product_title',
-        'value' => '存货名称',
-    ],
-    [
-        'key' =>'product_size',
-        'value' => '规格型号',
-    ],
-    [
-        'key' =>'unit',
-        'value' => '单位',
-    ],
-    [
-        'key' =>'quantity',
-        'value' => '开票数量',
-        'sum' => 1,
-    ],
-    [
-        'key' =>'price_1',
-        'value' => '单价',
-    ],
-    [
-        'key' =>'price_1_total',
-        'value' => '开票金额',
-        'sum' => 1,
-    ],
-    [
-        'key' =>'price_4',
-        'value' => '业务成本单价',
-        'value1' => '存货档案中的业务成本单价',
-    ],
-    [
-        'key' =>'price_4_total',
-        'value' => '业务成本金额',
-        'value1' => '开票数量 * 业务成本单价',
-        'sum' => 1,
-    ],
-    [
-        'key' =>'profit',
-        'value' => '毛利',
-        'value1' => '开票金额 - 业务成本金额',
-        'sum' => 2,
-        'formula' => 'price_1_total - price_4_total',
-    ],
-    [
-        'key' =>'profit_rate',
-        'value' => '毛利率%',
-        'value1' => '毛利 / 开票金额',
-        'sum' => 2,
-        'formula' => 'profit / price_1_total * 100',
-    ],
-];

+ 0 - 50
config/header/71.php

@@ -1,50 +0,0 @@
-<?php
-/**
- * '菜单ID' => [
- *     '字段英文名' =》 '字段中文名'
- * ]
- */
-
-return [
-    [
-        'key' =>'order_number',
-        'value' => '回款单号',
-    ],
-    [
-        'key' =>'order_time',
-        'value' => '单据日期',
-    ],
-    [
-        'key' =>'employee_id_1_title',
-        'value' => '业务员',
-    ],
-    [
-        'key' =>'employee_id_2_title',
-        'value' => '上级管理人员',
-    ],
-    [
-        'key' =>'payment_amount',
-        'value' => '回款金额',
-        'sum' => 1,
-    ],
-    [
-        'key' =>'price_4_total',
-        'value' => '业务成本金额',
-        'value1' => '开票数量 * 存货业务成本单价',
-        'sum' => 1,
-    ],
-    [
-        'key' =>'profit',
-        'value' => '毛利',
-        'value1' => '回款金额 - 业务成本金额',
-        'sum' => 2,
-        'formula' => 'payment_amount - price_4_total',
-    ],
-    [
-        'key' =>'profit_rate',
-        'value' => '毛利率%',
-        'value1' => '毛利 / 回款金额',
-        'sum' => 2,
-        'formula' => 'profit / payment_amount * 100',
-    ],
-];

+ 0 - 31
config/header/72.php

@@ -1,31 +0,0 @@
-<?php
-/**
- * '菜单ID' => [
- *     '字段英文名' =》 '字段中文名'
- * ]
- */
-
-return [
-    [
-        'key' =>'employee_id_1_title',
-        'value' => '业务人员名',
-    ],
-    [
-        'key' =>'send_time',
-        'value' => '发放日期',
-    ],
-    [
-        'key' =>'belong_time',
-        'value' => '归属日期',
-        'value1' => '分红发放的金额归属于某个季度中,最后用于分红利润的已发放金额合计',
-    ],
-    [
-        'key' =>'give_out_amount',
-        'value' => '分红已发放金额',
-        'is_total' => true,
-    ],
-    [
-        'key' =>'mark',
-        'value' => '备注',
-    ],
-];

+ 0 - 91
config/header/73.php

@@ -1,91 +0,0 @@
-<?php
-/**
- * '菜单ID' => [
- *     '字段英文名' =》 '字段中文名'
- * ]
- */
-
-return [
-    [
-        'key' =>'order_time',
-        'value' => '统计年月',
-    ],
-    [
-        'key' =>'employee_id_1_title',
-        'value' => '业务员',
-    ],
-    [
-        'key' =>'payment_amount',
-        'value' => '回款总金额',
-        'is_total' => true,
-    ],
-    [
-        'key' =>'payment_amount_not_include_activity',
-        'value' => '回款金额(非活动)',
-        'value1' => '业务员所有非活动属性的回款单金额总计',
-        'is_total' => true,
-    ],
-    [
-        'key' =>'payment_amount_activity',
-        'value' => '回款金额(活动)',
-        'value1' => '业务员所有活动属性的回款单金额总计',
-        'is_total' => true,
-    ],
-    [
-        'key' =>'payment_amount_lower_than_rate',
-        'value' => '回款金额(毛利率低于预设的客户毛利率)',
-        'value1' => '汇总条件
-                     一:非活动属性的回款单
-                     二:回款单明细的毛利率<T+中的客户档案的毛利率
-                     达成条件,则汇总回款金额',
-        'is_total' => true,
-    ],
-    [
-        'key' =>'payment_amount_greater_than_rate',
-        'value' => '回款金额(毛利率高于预设的客户毛利率)',
-        'value1' => '汇总条件
-                     一:非活动属性的回款单
-                     二:回款单明细的毛利率>=T+中的客户档案的毛利率
-                     达成条件,则汇总回款金额',
-        'is_total' => true,
-    ],
-    [
-        'key' =>'business',
-        'value' => '成本金额',
-        'value1' => '汇总条件
-                     一:非活动属性的回款单
-                     二:回款单明细的毛利率>=T+中的客户档案的毛利率
-                     达成条件,则汇总存货的存货业务成本金额',
-        'is_total' => true,
-    ],
-    [
-        'key' =>'salary_bonus',
-        'value' => '销售奖金',
-        'value1' => '人员档案中该业务员统计年月内的销售奖金',
-        'is_total' => true,
-    ],
-    [
-        'key' =>'index_1',
-        'value' => '预支分红比例',
-        'value1' => '人员档案中该业务员统计年月内的预支分红比例',
-        'is_total' => false,
-    ],
-    [
-        'key' =>'pay_in_advance',
-        'value' => '预支分红提成',
-        'value1' => '回款金额(毛利率高于预设的客户毛利率) * 预支分红比例',
-        'is_total' => true,
-    ],
-    [
-        'key' =>'basic_salary',
-        'value' => '基本工资',
-        'value1' => '人员档案中该业务员统计年月内的基本工资',
-        'is_total' => true,
-    ],
-    [
-        'key' =>'should_pay',
-        'value' => '应发金额',
-        'value1' => '销售奖金 + 预支分红提成 + 基本工资',
-        'is_total' => true,
-    ],
-];

+ 0 - 53
config/header/74.php

@@ -1,53 +0,0 @@
-<?php
-/**
- * '菜单ID' => [
- *     '字段英文名' =》 '字段中文名'
- * ]
- */
-
-return [
-    [
-        'key' =>'check_time',
-        'value' => '核算时间区间',
-        'value1' => '人员档案中预设的(季度指标金额)时间段',
-    ],
-    [
-        'key' =>'employee_id_2_title',
-        'value' => '上级管理人员',
-    ],
-    [
-        'key' =>'payment_amount',
-        'value' => '回款金额',
-        'is_total' => true,
-    ],
-    [
-        'key' =>'index',
-        'value' => '季度指标金额',
-    ],
-    [
-        'key' =>'index_1',
-        'value' => '预支分红比例%',
-    ],
-    [
-        'key' =>'index_5',
-        'value' => '分红比例%',
-    ],
-    [
-        'key' =>'should_pay',
-        'value' => '应发放金额',
-        'value1' => '条件一:(回款金额 < 季度指标金额)公式:回款金额 *(分红比例 / 2 - 预支分红比例 / 2);
-                     条件二:(回款金额 >= 季度指标金额) 公式:回款金额 *(分红比例 / 2 - 预支分红比例 / 2 +(回款金额 - 季度指标金额)* 0.15 / 2)
-                     ',
-        'is_total' => true,
-    ],
-    [
-        'key' =>'payed',
-        'value' => '已发放金额',
-        'is_total' => true,
-    ],
-    [
-        'key' =>'not_pay',
-        'value' => '未发放金额',
-        'is_total' => true,
-    ],
-];

+ 29 - 0
config/header/77.php

@@ -0,0 +1,29 @@
+<?php
+/**
+ * '菜单ID' => [
+ *     '字段英文名' =》 '字段中文名'
+ * ]
+ */
+
+return [
+    [
+        'key' =>'order_date',
+        'value' => '订单日期',
+    ],
+    [
+        'key' =>'order_number',
+        'value' => '订单编号',
+    ],
+    [
+        'key' =>'business_type',
+        'value' => '业务类型',
+    ],
+    [
+        'key' =>'supplier_title',
+        'value' => '供应商',
+    ],
+    [
+        'key' =>'crt_name',
+        'value' => '制单人',
+    ],
+];

+ 25 - 0
config/header/78.php

@@ -0,0 +1,25 @@
+<?php
+/**
+ * '菜单ID' => [
+ *     '字段英文名' =》 '字段中文名'
+ * ]
+ */
+
+return [
+    [
+        'key' =>'order_date',
+        'value' => '日期',
+    ],
+    [
+        'key' =>'order_number',
+        'value' => '单据编号',
+    ],
+    [
+        'key' =>'supplier_title',
+        'value' => '供应商',
+    ],
+    [
+        'key' =>'crt_name',
+        'value' => '制单人',
+    ],
+];

+ 29 - 0
config/header/79.php

@@ -0,0 +1,29 @@
+<?php
+/**
+ * '菜单ID' => [
+ *     '字段英文名' =》 '字段中文名'
+ * ]
+ */
+
+return [
+    [
+        'key' =>'order_date',
+        'value' => '日期',
+    ],
+    [
+        'key' =>'order_number',
+        'value' => '单据号',
+    ],
+    [
+        'key' =>'business_type',
+        'value' => '业务类型',
+    ],
+    [
+        'key' =>'purchase_name',
+        'value' => '请购人',
+    ],
+    [
+        'key' =>'crt_name',
+        'value' => '制单人',
+    ],
+];

+ 7 - 0
routes/api.php

@@ -26,6 +26,7 @@ Route::any('getExport/{file_name}','Api\SysMenuController@getExport');
 
 Route::any('getAccessToken','Api\DingTalkController@getAccessToken');
 Route::any('getUserByCode','Api\DingTalkController@getUserByCode');
+Route::any('getTemplateFields','Api\DingTalkController@getTemplateFields');
 
 Route::group(['middleware'=> ['checkLogin']],function ($route){
     //文件上传统一方法
@@ -85,6 +86,12 @@ Route::group(['middleware'=> ['checkLogin']],function ($route){
     $route->any('exportFile', 'Api\ExportFileController@exportFile');
 
     $route->any('purchaseRequisition', 'Api\U8Controller@purchaseRequisition');
+    $route->any('purchaseRequisitionDetail', 'Api\U8Controller@purchaseRequisitionDetail');
     $route->any('purchaseOrder', 'Api\U8Controller@purchaseOrder');
+    $route->any('purchaseOrderDetail', 'Api\U8Controller@purchaseOrderDetail');
     $route->any('paymentOrder', 'Api\U8Controller@paymentOrder');
+    $route->any('paymentOrderDetail', 'Api\U8Controller@paymentOrderDetail');
+
+    //创建审批
+    $route->any('createProcessInstance','Api\DingTalkController@createProcessInstance');
 });