Explorar o código

客户管理-项目页

Zhouzhendong %!s(int64=5) %!d(string=hai) anos
pai
achega
38f07ac1d5

+ 159 - 4
app/Http/Controllers/CustomerController.php

@@ -2,6 +2,7 @@
 
 namespace App\Http\Controllers;
 
+use App\Owner;
 use App\Services\OwnerReportService;
 use App\Services\OwnerService;
 use Exception;
@@ -10,6 +11,7 @@ use Illuminate\Http\Request;
 use Illuminate\Http\Response;
 use Illuminate\Support\Facades\Gate;
 use Illuminate\Support\Facades\Http;
+use Illuminate\Support\Facades\Validator;
 
 class CustomerController extends Controller
 {
@@ -35,7 +37,7 @@ class CustomerController extends Controller
 
     public function projectReportExport(Request $request)
     {
-        if(!Gate::allows('客户管理-项目-报表')){ return '没有权限';  }
+        if(!Gate::allows('客户管理-项目-报表')){ return redirect('denied');  }
         /** @var OwnerReportService $service */
         $service = app('OwnerReportService');
         $withs = ["ownerBillReport","owner"=>function($query){
@@ -82,14 +84,145 @@ class CustomerController extends Controller
         if(!Gate::allows('客户管理-项目-查询')){ return redirect('denied');  }
         /** @var OwnerService $service */
         $service = app('OwnerService');
-        $customers = $service->get(['customer_id'=>true],['customer']);
-        return response()->view('customer.project.index');
+        $owners = $service->paginate(['customer_id'=>true],['customer',"userOwnerGroup","ownerStoragePriceModels","ownerAreaReport"=>function($query){
+            $month = date('Y-m');
+            /** @var Builder $query */
+            $query->where("counting_month","like",$month."%");
+        }]);
+        return response()->view('customer.project.index',compact("owners"));
+    }
+
+    public function projectIndexExport(Request $request)
+    {
+        if(!Gate::allows('客户管理-项目-查询')){ return redirect('denied');  }
+        /** @var OwnerService $service */
+        $service = app('OwnerService');
+        $withs = ['customer',"userOwnerGroup","ownerStoragePriceModels","ownerAreaReport"=>function($query){
+            $month = date('Y-m');
+            /** @var Builder $query */
+            $query->where("counting_month","like",$month."%");
+        }];
+        $params = $request->input();
+        $params['customer_id']=true;
+        if ($request->checkAllSign ?? false) unset($params['checkAllSign']);
+        else $params = ["id"=>$request->data ?? ''];
+        $owners = $service->get($params,$withs);
+        $column = ["客户","税率","项目","货主代码","合同号","创建日期","销售名称","公司全称","联系人","联系电话","项目小组","用仓类型","当月结算面积","月单量预警","是否激活","项目描述"];
+        $list = [];
+        foreach ($owners as $owner){
+            $list[] = [
+                $owner->customer ? $owner->customer->name : '',
+                $owner->tax_rate,
+                $owner->name,
+                $owner->code,
+                $owner->contract_number,
+                $owner->created_at,
+                $owner->salesman,
+                $owner->customer ? $owner->customer->company_name : '',
+                $owner->linkman,
+                $owner->phone_number,
+                $owner->userOwnerGroup ? $owner->userOwnerGroup->name : '',
+                implode(",",array_unique(array_column(($owner->ownerStoragePriceModels)->toArray(),"using_type"))),
+                $owner->ownerAreaReport ? $owner->ownerAreaReport->accounting_area : '',
+                $owner->waring_line_on,
+                $owner->deleted_at ? '否' : '是',
+                $owner->description
+            ];
+        }
+        $post = Http::post(config('go.export.url'),['type'=>'base','data'=>json_encode(["row"=>$column,"list"=>$list],JSON_UNESCAPED_UNICODE)]);
+        if ($post->status() == 500){
+            throw new Exception($post->header("Msg"));
+        }
+        return response($post,200, [
+            "Content-type"=>"application/octet-stream",
+            "Content-Disposition"=>"attachment; filename=客户报表-".date('ymdHis').'.xlsx',
+        ]);
     }
 
     public function projectCreate()
     {
         if(!Gate::allows('客户管理-项目-录入')){ return redirect('denied');  }
-        return response()->view('customer.project.create');
+        $customers = app('CustomerService')->getSelection();
+        $ownerGroups = app('UserOwnerGroupService')->getSelection();
+        $storagePriceModels = app('OwnerStoragePriceModelService')->getSelection(["id","counting_type","using_type","minimum_area","price","unit_id"],["unit"=>function($query){$query->select("id","name");}]);
+        $owner = null;
+        return response()->view('customer.project.create',compact("customers","ownerGroups","storagePriceModels","owner"));
+    }
+
+    public function seekOwner(Request $request)
+    {
+        $params = $request->input();
+        $params["customer_id"] = true;
+        $owner = app('OwnerService')->first($params,["customer_id"=>"null"]);
+        if ($owner)return ["success"=>true,"data"=>$owner];
+        else return ["success"=>false];
+    }
+
+    public function projectStore(Request $request)
+    {
+        if(!Gate::allows('客户管理-项目-录入')){ return redirect('denied');  }
+        $this->validator($request->input())->validate();
+        $params = $request->input();
+        if ($params["id"]){
+            /** @var Owner $owner */
+            $owner = app('OwnerService')->find($params["id"]);
+            app('OwnerService')->update($owner,[
+                "customer_id"           => $params["customer_id"],
+                "tax_rate"              => $params["tax_rate"],
+                "contract_number"       => $params["contract_number"],
+                "salesman"              => $params["salesman"],
+                "linkman"               => $params["linkman"],
+                "phone_number"          => $params["phone_number"],
+                "user_owner_group_id"   => $params["owner_group_id"],
+                "waring_line_on"        => $params["waring_line_on"],
+                "description"           => $params["description"],
+            ],[
+                "ownerStoragePriceModels" => explode(',',$params["owner_storage_price_model_id"])
+            ]);
+            $msg = "成功更新“".$owner->name."”的信息!";
+        }else{
+            $owner = app('OwnerService')->create([
+                "name"                  => $params["name"],
+                "code"                  => $params["code"],
+                "customer_id"           => $params["customer_id"],
+                "tax_rate"              => $params["tax_rate"],
+                "contract_number"       => $params["contract_number"],
+                "salesman"              => $params["salesman"],
+                "linkman"               => $params["linkman"],
+                "phone_number"          => $params["phone_number"],
+                "user_owner_group_id"   => $params["owner_group_id"],
+                "waring_line_on"        => $params["waring_line_on"],
+                "description"           => $params["description"],
+            ],[
+                "ownerStoragePriceModels" => explode(',',$params["owner_storage_price_model_id"])
+            ]);
+            $msg = "成功创建“".$owner->name."”项目!";
+        }
+        return response()->redirectTo('customer/project/index')->with('successTip',$msg);
+    }
+
+    //获取货主下所有相关计费模型
+    public function getOwnerPriceModel(Request $request)
+    {
+        $owner = new Owner();
+        $owner->id = $request->id;
+        $owner->load(["ownerPriceOperations","ownerPriceExpresses","ownerPriceLogistics","ownerPriceDirectLogistics"]);
+        return ["success"=>true,"data"=>["ownerPriceOperations"=>$owner->ownerPriceOperations,
+            "ownerPriceExpresses"=>$owner->ownerPriceExpresses,
+            "ownerPriceLogistics"=>$owner->ownerPriceLogistics,
+            "ownerPriceDirectLogistics"=>$owner->ownerPriceDirectLogistics]];
+    }
+
+    public function projectEdit($id)
+    {
+        if(!Gate::allows('客户管理-项目-编辑')){ return redirect('denied');  }
+        /** @var Owner $owner */
+        $owner = app('OwnerService')->find($id);
+        $owner->owner_storage_price_model_id = $owner->getOwnerStoragePriceModelIds();
+        $customers = app('CustomerService')->getSelection();
+        $ownerGroups = app('UserOwnerGroupService')->getSelection();
+        $storagePriceModels = app('OwnerStoragePriceModelService')->getSelection(["id","counting_type","using_type","minimum_area","price","unit_id"],["unit"=>function($query){$query->select("id","name");}]);
+        return response()->view('customer.project.create',compact("customers","ownerGroups","storagePriceModels",'owner'));
     }
 
     public function projectArea()
@@ -109,4 +242,26 @@ class CustomerController extends Controller
         if(!Gate::allows('客户管理-财务-账单确认')){ return redirect('denied');  }
         return response()->view('customer.finance.billConfirmation');
     }
+
+    private function validator(array $params){
+        $id = $params['id'] ?? null;
+        $validator=Validator::make($params,[
+            'id' => ['required_without_all:code,name'],
+            'code'=>['required','max:50',$id ? "unique:owners,code,$id":'unique:owners,code'],
+            'name'=>['required','max:50'],
+            'customer_id'=>['required'],
+            'owner_group_id'=>['required'],
+            'tax_rate' => ['required','numeric'],
+        ],[
+            'required'=>':attribute 为必填项',
+            'unique'=>':attribute 已存在',
+        ],[
+            'code'=>'项目代码',
+            'name'=>'项目名称',
+            'customer_id'=>'客户',
+            'owner_group_id'=>'工作组',
+            'tax_rate' => '税率'
+        ]);
+        return $validator;
+    }
 }

+ 1 - 1
app/Http/Controllers/TestController.php

@@ -88,7 +88,7 @@ class TestController extends Controller
     }
 
     public function test4(){
-        dd(Unit::query()->whereIn('name',[])->get());
+        dd(date('Y-m'));
 
     }
 

+ 41 - 0
app/Owner.php

@@ -70,4 +70,45 @@ class Owner extends Model
     {   //项目组
         return $this->hasOne(UserOwnerGroup::class,"id","user_owner_group_id");
     }
+    public function ownerStoragePriceModels()
+    {   //仓储计费
+        return $this->belongsToMany(OwnerStoragePriceModel::class,"owner_storage_price_model_owner","owner_id","owner_storage_price_model_id");
+    }
+    public function ownerAreaReport()
+    {   //面积报表
+        return $this->hasOne(OwnerAreaReport::class,"owner_id","id");
+    }
+    public function ownerStoragePriceModelOwners()
+    {   //仓储计费-货主 中间表
+        return $this->hasMany(OwnerStoragePriceModelOwner::class,"owner_id","id");
+    }
+    public function ownerPriceOperations()
+    {   //作业计费
+        return $this->belongsToMany(OwnerPriceOperation::class,"owner_price_operation_owner","owner_id","owner_price_operation_id");
+    }
+    public function ownerPriceExpresses()
+    {   //快递计费
+        return $this->belongsToMany(OwnerPriceExpress::class,"owner_price_express_owner","owner_id","owner_price_express_id");
+    }
+    public function ownerPriceLogistics()
+    {   //物流计费
+        return $this->belongsToMany(OwnerPriceLogistic::class,"owner_price_logistic_owner","owner_id","owner_price_logistic_id");
+    }
+    public function ownerPriceDirectLogistics()
+    {   //直发车计费
+        return $this->belongsToMany(OwnerPriceDirectLogistic::class,"owner_price_direct_logistic_owner","owner_id","owner_price_direct_logistic_id");
+    }
+
+    public function getOwnerStoragePriceModelIds($type = 'string')
+    {   //获取仓储计费的关联ID字符串或数组
+        $this->load('ownerStoragePriceModelOwners');
+        if ($type == 'string'){
+            $ids = '';
+            foreach ($this->ownerStoragePriceModelOwners as $os){
+                $ids .= $os->owner_storage_price_model_id.",";
+            }
+            return $ids;
+        }
+        return array_column(($this->ownerStoragePriceModelOwners)->toArray(),"owner_storage_price_model_id");
+    }
 }

+ 10 - 0
app/OwnerStoragePriceModelOwner.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class OwnerStoragePriceModelOwner extends Model
+{
+    protected $table = "owner_storage_price_model_owner";
+}

+ 3 - 0
app/Providers/AppServiceProvider.php

@@ -31,6 +31,7 @@ use App\Services\OrderPackageCommoditiesService;
 use App\Services\OrderTrackingService;
 use App\Services\OwnerReportService;
 use App\Services\OwnerService;
+use App\Services\OwnerStoragePriceModelService;
 use App\Services\PackageStatisticsService;
 use App\Services\ProcessesContentService;
 use App\Services\ProcessMethodService;
@@ -133,6 +134,7 @@ class AppServiceProvider extends ServiceProvider
         app()->singleton('StoreService',StoreService::class);
         app()->singleton('WarehouseService',WarehouseService::class);
         app()->singleton('StoreItemService',StoreItemService::class);
+        app()->singleton('OwnerReportService',OwnerReportService::class);
 
         $this->loadingOrderModuleService();
         $this->loadingBasedModuleService();
@@ -160,6 +162,7 @@ class AppServiceProvider extends ServiceProvider
         app()->singleton('DepositoryService',DepositoryService::class);
         app()->singleton('UserOwnerGroupService',UserOwnerGroupService::class);
         app()->singleton('CustomerService',CustomerService::class);
+        app()->singleton('OwnerStoragePriceModelService',OwnerStoragePriceModelService::class);
     }
 
     private function loadingRejectedModuleService(){

+ 33 - 1
app/Services/OwnerService.php

@@ -65,14 +65,29 @@ Class OwnerService
                     case "or":
                         $owner->orWhere($column, $value);
                         break;
+                    case "null":
+                        $owner->whereNull($column);
                 }
             }
         }
         return $owner->first();
     }
 
-    public function create(array $params){
+    public function find($id)
+    {
+        return Owner::query()->find($id);
+    }
+
+    public function update(Owner $owner, array $values, array $related = [])
+    {
+        if ($related["ownerStoragePriceModels"] ?? false)$owner->ownerStoragePriceModels()->sync($related["ownerStoragePriceModels"]);
+        return $owner->update($values);
+    }
+
+    public function create(array $params, array $related = []){
+        /** @var Owner $owner */
         $owner = Owner::query()->create($params);
+        if ($related["ownerStoragePriceModels"] ?? false)$owner->ownerStoragePriceModels()->syncWithoutDetaching($related["ownerStoragePriceModels"]);
         return $owner;
     }
 
@@ -144,6 +159,7 @@ Class OwnerService
         /** @var User $user */
         $user = Auth::user();
         $query = Owner::query();
+        if ($withs)$query->with($withs);
         if ($authority){
             $ids = $user->getPermittingOwnerIdsAttribute();
             if ($ids) $query->whereIn("id",$ids);
@@ -154,6 +170,22 @@ Class OwnerService
         return $query->get();
     }
 
+    public function paginate(array $params, array $withs = null, bool $authority = true, bool $notShowSoftDelete = false)
+    {
+        /** @var User $user */
+        $user = Auth::user();
+        $query = Owner::query();
+        if ($withs)$query->with($withs);
+        if ($authority){
+            $ids = $user->getPermittingOwnerIdsAttribute();
+            if ($ids) $query->whereIn("id",$ids);
+            else return null;
+        }
+        if ($notShowSoftDelete) $query->whereNull('deleted_at');
+        $query = $this->query($query,$params);
+        return $query->paginate($params["paginate"] ?? 50);
+    }
+
     private function query(Builder $builder, array $params)
     {
         foreach ($params as $column => $param){

+ 14 - 0
app/Services/OwnerStoragePriceModelService.php

@@ -0,0 +1,14 @@
+<?php 
+
+namespace App\Services; 
+
+use App\OwnerStoragePriceModel;
+
+Class OwnerStoragePriceModelService
+{ 
+    public function getSelection(array $columns = ["counting_type","using_type"], array $withs = [])
+    {
+        return OwnerStoragePriceModel::query()->select($columns)->with($withs)->get();
+    }
+
+}

+ 3 - 3
database/factories/OwnerBillReportFactory.php

@@ -4,9 +4,9 @@
 
 use App\OwnerBillReport;
 use Faker\Generator as Faker;
-
-$factory->define(OwnerBillReport::class, function (Faker $faker) {
-    $owner = \App\Owner::query()->whereNotNull("user_owner_group_id")->first();
+$owner = \App\Owner::query()->whereNotNull("user_owner_group_id")->first();
+$factory->define(OwnerBillReport::class, function (Faker $faker)use(&$owner) {
+    if (!$owner)$owner = \App\Owner::query()->whereNotNull("user_owner_group_id")->first();
     $initial_fee = mt_rand(0,50000) / 10;
     $confirm_fee = mt_rand(0,50000) / 10;
     return [

+ 22 - 0
database/factories/OwnerStoragePriceModelFactory.php

@@ -0,0 +1,22 @@
+<?php
+
+/** @var \Illuminate\Database\Eloquent\Factory $factory */
+
+use App\OwnerStoragePriceModel;
+use Faker\Generator as Faker;
+$unit = \App\Unit::query()->first();
+$factory->define(OwnerStoragePriceModel::class, function (Faker $faker) use(&$unit){
+    if (!$unit) $unit = \App\Unit::query()->first();
+    $counting_type = ['包仓','灵活用仓','统单价'];
+    $using_type = ['常温','恒温'];
+    $discount_type = ['无减免','按单减免','固定减免'];
+    return [
+        "counting_type" => array_rand($counting_type),    //计费类型
+        "using_type" => array_rand($using_type),       //用仓类型
+        "minimum_area" => mt_rand(100,1000) / 50,     //最低起租面积
+        "price" => mt_rand(1,20) / 10,            //单价
+        "discount_type" => array_rand($discount_type),    //减免类型
+        "discount_value" => mt_rand(0,10) / 12,   //减免值
+        "unit_id" => $unit ? $unit->id : factory(\App\Unit::class),          //单位ID
+    ];
+});

+ 12 - 0
database/factories/UnitFactory.php

@@ -0,0 +1,12 @@
+<?php
+
+/** @var \Illuminate\Database\Eloquent\Factory $factory */
+
+use App\Unit;
+use Faker\Generator as Faker;
+
+$factory->define(Unit::class, function (Faker $faker) {
+    return [
+        'name' => $faker->name
+    ];
+});

+ 2 - 2
database/migrations/2020_10_27_142647_create_owner_storage_price_model_table.php

@@ -13,7 +13,7 @@ class CreateOwnerStoragePriceModelTable extends Migration
      */
     public function up()
     {
-        Schema::create('owner_storage_price_model', function (Blueprint $table) {
+        Schema::create('owner_storage_price_models', function (Blueprint $table) {
             $table->id();
             $table->enum("counting_type",["包仓","灵活用仓","统单价"])->default("灵活用仓")->comment('计费类型');
             $table->enum("using_type",["常温","恒温"])->default("常温")->comment('用仓类型');
@@ -33,6 +33,6 @@ class CreateOwnerStoragePriceModelTable extends Migration
      */
     public function down()
     {
-        Schema::dropIfExists('owner_storage_price_model');
+        Schema::dropIfExists('owner_storage_price_models');
     }
 }

+ 1 - 0
database/migrations/2020_10_28_170858_save_customer_authority_data.php

@@ -12,6 +12,7 @@ class SaveCustomerAuthorityData extends Migration
         '客户管理-项目-查询',
         '客户管理-项目-录入',
         '客户管理-项目-面积',
+        '客户管理-项目-编辑',
         '客户管理-财务-即时账单',
         '客户管理-财务-账单确认',
         '计费模型-仓储',

+ 31 - 0
database/migrations/2020_11_02_095633_create_owner_storage_price_model_owner_table.php

@@ -0,0 +1,31 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateOwnerStoragePriceModelOwnerTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('owner_storage_price_model_owner', function (Blueprint $table) {
+            $table->bigInteger("owner_storage_price_model_id")->comment("外键仓储计费");
+            $table->bigInteger("owner_id")->comment("外键货主");
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('owner_storage_price_model_owner');
+    }
+}

+ 31 - 0
database/migrations/2020_11_03_095611_create_owner_price_operation_owner_table.php

@@ -0,0 +1,31 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateOwnerPriceOperationOwnerTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('owner_price_operation_owner', function (Blueprint $table) {
+            $table->bigInteger("owner_price_operation_id")->comment("外键作业价格");
+            $table->bigInteger("owner_id")->comment("外键货主");
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('owner_price_operation_owner');
+    }
+}

+ 31 - 0
database/migrations/2020_11_03_101827_create_owner_price_direct_logistic_owner_table.php

@@ -0,0 +1,31 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateOwnerPriceDirectLogisticOwnerTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('owner_price_direct_logistic_owner', function (Blueprint $table) {
+            $table->bigInteger("owner_price_direct_logistic_id")->comment("外键直发车价格");
+            $table->bigInteger("owner_id")->comment("外键货主");
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('owner_price_direct_logistic_owner');
+    }
+}

+ 1 - 0
database/seeds/DatabaseSeeder.php

@@ -14,6 +14,7 @@ class DatabaseSeeder extends Seeder
         // $this->call(UsersTableSeeder::class);
         $this->call([
             OwnerReportSeeder::class,
+            OwnerStoragePriceModelSeeder::class
         ]);
     }
 }

+ 16 - 0
database/seeds/OwnerStoragePriceModelSeeder.php

@@ -0,0 +1,16 @@
+<?php
+
+use Illuminate\Database\Seeder;
+
+class OwnerStoragePriceModelSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        factory(\App\OwnerStoragePriceModel::class,3)->create();
+    }
+}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
public/css/app.css


+ 4 - 4
public/js/app.js

@@ -2330,7 +2330,7 @@ function fromByteArray (uint8) {
 var BlobBuilder = typeof BlobBuilder !== 'undefined' ? BlobBuilder :
   typeof WebKitBlobBuilder !== 'undefined' ? WebKitBlobBuilder :
   typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder :
-  typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder :
+  typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : 
   false;
 
 /**
@@ -86472,8 +86472,8 @@ module.exports = tempTip;
 /*! no static exports found */
 /***/ (function(module, exports, __webpack_require__) {
 
-__webpack_require__(/*! D:\phpstudy_pro\WWW\bswas\resources\js\app.js */"./resources/js/app.js");
-module.exports = __webpack_require__(/*! D:\phpstudy_pro\WWW\bswas\resources\sass\app.scss */"./resources/sass/app.scss");
+__webpack_require__(/*! D:\Demo\bswas\resources\js\app.js */"./resources/js/app.js");
+module.exports = __webpack_require__(/*! D:\Demo\bswas\resources\sass\app.scss */"./resources/sass/app.scss");
 
 
 /***/ }),
@@ -86489,4 +86489,4 @@ module.exports = __webpack_require__(/*! D:\phpstudy_pro\WWW\bswas\resources\sas
 
 /***/ })
 
-/******/ });
+/******/ });

+ 131 - 23
resources/views/customer/project/create.blade.php

@@ -2,61 +2,92 @@
 @section('title')客户管理-项目录入@endsection
 
 @section('content')
-    @component('customer.project.menu')@endcomponent
+    @component('customer.project.menu')
+        @if($owner)
+            <li class="nav-item">
+                <a class="nav-link" href="{{URL::current()}}" :class="{active:isActive('edit',4)}">编辑</a>
+            </li>
+        @endif
+    @endcomponent
     <div class="container-fluid card" id="container">
         <div class="card-body offset-3">
-            <form method="GET" action="{{url('')}}" class="mt-3">
+            <form method="POST" action="{{url('customer/project/store')}}" class="mt-3">
+                @csrf
+                <label><input hidden name="id" :value="owner.id"></label>
                 <div class="row">
                     <label for="code" class="col-2 text-info">项目代码</label>
-                    <input type="text" required id="code" class="form-control form-control-sm col-7"  name="code">
+                    <input :readonly="display" type="text"  id="code" class="form-control form-control-sm col-7 mb-0" :class="errors.code ? 'is-invalid' : ''" v-model="owner.code"  name="code" @change="codeSeekOwner()">
+                    <span class="invalid-feedback mt-0 offset-2" role="alert" v-if="errors.code">
+                        <strong>@{{ errors.code[0] }}</strong>
+                    </span>
                 </div>
                 <div class="row mt-3">
                     <label for="name" class="col-2 text-info">项目名称</label>
-                    <input type="text" id="name" class="form-control form-control-sm col-7"  name="name">
+                    <input :readonly="display" type="text"  id="name" class="form-control form-control-sm col-7 mb-0" :class="errors.name ? 'is-invalid' : style" v-model="owner.name" name="name" @change="nameSeekOwner()">
+                    <span class="invalid-feedback mt-0 offset-2" role="alert" v-if="errors.name">
+                        <strong>@{{ errors.name[0] }}</strong>
+                    </span>
                 </div>
                 <div class="row mt-3">
-                    <label for="owner_id" class="col-2">客户</label>
-                    <select id="owner_id" class="form-control form-control-sm col-4"  name="owner_id">
-                        <option> </option>
+                    <label for="customer_id" class="col-2 text-info">客户</label>
+                    <select id="customer_id" v-model="owner.customer_id" class="form-control form-control-sm col-4 mb-0" :class="errors.customer_id ? 'is-invalid' : ''"  name="customer_id" >
                         <option v-for="customer in customers" :value="customer.id">@{{ customer.name }}</option>
                     </select>
+                    <span class="invalid-feedback mt-0 offset-2" role="alert" v-if="errors.customer_id">
+                        <strong>@{{ errors.customer_id[0] }}</strong>
+                    </span>
                 </div>
                 <div class="row mt-3">
-                    <label for="workgroup_id" class="col-2">项目小组</label>
-                    <select id="workgroup_id" class="form-control form-control-sm col-4"  name="workgroup_id">
-                        <option> </option>
-                        <option v-for="group in groups" :value="group.id">@{{ group.name }}</option>
+                    <label for="owner_group_id" class="col-2 text-info">项目小组</label>
+                    <select id="owner_group_id" v-model="owner.owner_group_id" class="form-control form-control-sm col-4 mb-0" :class="errors.owner_group_id ? 'is-invalid' : ''"  name="owner_group_id" >
+                        <option v-for="ownerGroup in ownerGroups" :value="ownerGroup.id">@{{ ownerGroup.name }}</option>
                     </select>
+                    <span class="invalid-feedback offset-2 mt-0" role="alert" v-if="errors.owner_group_id">
+                        <strong>@{{ errors.owner_group_id[0] }}</strong>
+                    </span>
                 </div>
                 <div class="row mt-3">
-                    <label class="col-2" for="type">仓储计费类型</label>
-                    <select id="type" name="type" class="selectpicker" multiple data-live-search="true" title="仓储计费类型(多选)">
-                        <option v-for="t in type" :value="t.id">@{{ t.name }}</option>
+                    <label class="col-2" for="owner_storage_price_model_id">仓储计费类型</label>
+                    <select id="owner_storage_price_model_id" v-model="owner.owner_storage_price_model_id" class="selectpicker" multiple data-live-search="true" title="仓储计费类型(多选)">
+                        <option v-for="t in storagePriceModels" :value="t.id" :data-subtext="'起:'+t.minimum_area+' '+t.unit_name+' 单:'+t.price+'/'+t.unit_name">
+                            @{{ t.counting_type }} - @{{ t.using_type }}
+                        </option>
                     </select>
+                    <label hidden><input :value="owner.owner_storage_price_model_id" name="owner_storage_price_model_id"></label>
                 </div>
                 <div class="row mt-3">
                     <label for="tax_rate" class="col-2">税率<span class="badge badge-secondary">%</span></label>
-                    <input type="number" id="tax_rate" class="form-control form-control-sm col-3"  name="tax_rate">
+                    <input type="number" v-model="owner.tax_rate" id="tax_rate" class="form-control form-control-sm col-3 mb-0" :class="errors.tax_rate ? 'is-invalid' : ''"  name="tax_rate">
+                    <span class="invalid-feedback offset-2 mt-0" role="alert" v-if="errors.tax_rate">
+                        <strong>@{{ errors.tax_rate[0] }}</strong>
+                    </span>
+                </div>
+                <div class="row mt-3">
+                    <label for="waring_line_on" class="col-2">月单量预警</label>
+                    <input type="number" v-model="owner.waring_line_on" id="waring_line_on" class="form-control form-control-sm col-3 mb-0" :class="errors.waring_line_on ? 'is-invalid' : ''"  name="waring_line_on">
+                    <span class="invalid-feedback offset-2 mt-0" role="alert" v-if="errors.waring_line_on">
+                        <strong>@{{ errors.waring_line_on[0] }}</strong>
+                    </span>
                 </div>
                 <div class="row mt-3">
                     <label for="contract_number" class="col-2">合同号</label>
-                    <input type="text" id="contract_number" class="form-control form-control-sm col-7"  name="contract_number">
+                    <input type="text" v-model="owner.contract_number" id="contract_number" class="form-control form-control-sm col-7"  name="contract_number">
                 </div>
                 <div class="row mt-3">
                     <label for="salesman" class="col-2">销售名称</label>
-                    <input type="text" id="salesman" class="form-control form-control-sm col-7"  name="salesman">
+                    <input type="text" v-model="owner.salesman" id="salesman" class="form-control form-control-sm col-7"  name="salesman">
                 </div>
                 <div class="row mt-3">
                     <label for="linkman" class="col-2">联系人</label>
-                    <input type="text" id="linkman" class="form-control form-control-sm col-7"  name="linkman">
+                    <input type="text" v-model="owner.linkman" id="linkman" class="form-control form-control-sm col-7"  name="linkman">
                 </div>
                 <div class="row mt-3">
                     <label for="phone_number" class="col-2">联系电话</label>
-                    <input type="text" id="phone_number" class="form-control form-control-sm col-7"  name="phone_number">
+                    <input type="text" v-model="owner.phone_number" id="phone_number" class="form-control form-control-sm col-7"  name="phone_number">
                 </div>
                 <div class="row mt-3">
                     <label for="description" class="col-2">项目描述</label>
-                    <textarea id="description" class="form-control form-control-sm col-7"  name="description"></textarea>
+                    <textarea id="description" v-model="owner.description" class="form-control form-control-sm col-7"  name="description"></textarea>
                 </div>
                 <button type="submit" class="btn btn-success mt-3 col-8 offset-1">提交</button>
             </form>
@@ -69,9 +100,86 @@
         new Vue({
             el:"#container",
             data:{
-                type : [{name:"常温",id:"1"},{name:"恒温",id:"2"},{name:"冷藏",id:"2"},],
-                customers : [{name:"TEST1",id:"1"},],
-                groups : [{name:'TEST1',id:"1"}],
+                owner : {
+                    id:"{{old('id') ?? ($owner->id ?? '') }}",
+                    name : "{{old('name') ?? ($owner->name ?? '')}}",
+                    code : "{{old('code') ?? ($owner->code ?? '')}}",
+                    customer_id : "{{old('customer_id') ?? ($owner->customer_id ?? '')}}",
+                    owner_group_id : "{{old('owner_group_id') ?? ($owner->user_owner_group_id ?? '')}}",
+                    owner_storage_price_model_id : "{{old('owner_storage_price_model_id') ?? ($owner->owner_storage_price_model_id ?? '')}}".split(','),
+                    tax_rate : "{{old('tax_rate') ?? ($owner->tax_rate ?? '')}}",
+                    contract_number : "{{old('contract_number') ?? ($owner->contract_number ?? '')}}",
+                    salesman : "{{old('salesman') ?? ($owner->salesman ?? '')}}",
+                    linkman : "{{old('linkman') ?? ($owner->linkman ?? '')}}",
+                    phone_number : "{{old('phone_number') ?? ($owner->phone_number ?? '')}}",
+                    description : "{{old('description') ?? ($owner->description ?? '')}}",
+                    waring_line_on : "{{old('waring_line_on') ?? ($owner->waring_line_on ?? '')}}",
+                },
+                storagePriceModels : [
+                    @foreach($storagePriceModels as $storagePriceModel)
+                    {   id:"{{$storagePriceModel->id}}",
+                        counting_type : "{{$storagePriceModel->counting_type}}",
+                        using_type : "{{$storagePriceModel->using_type}}",
+                        minimum_area : "{{$storagePriceModel->minimum_area}}",
+                        price : "{{$storagePriceModel->price}}",
+                        unit_name : "{{$storagePriceModel->unit ? $storagePriceModel->unit->name : ''}}",
+                    },
+                    @endforeach
+                ],
+                customers : [
+                    @foreach($customers as $customer)
+                    {id:"{{$customer->id}}",name:"{{$customer->name}}"},
+                    @endforeach
+                ],
+                ownerGroups : [
+                    @foreach($ownerGroups as $ownerGroup)
+                    {id:"{{$ownerGroup->id}}",name:"{{$ownerGroup->name}}"},
+                    @endforeach
+                ],
+                style : '',
+                errors : {!! $errors !!},
+                display:false,
+            },
+            mounted(){
+                if (this.errors.length===0 && this.owner.id){
+                    this.display = true;
+                }
+            },
+            methods:{
+                nameSeekOwner(){
+                    this.style = "";
+                    window.axios.post('{{url('customer/project/seekOwner')}}',{name:this.owner.name})
+                        .then(res=>{
+                            if (res.data.success){
+                                if (!this.owner.code){
+                                    this.owner.code = res.data.data.code;
+                                    this.owner.id = res.data.data.id;
+                                    return;
+                                }
+                                if (this.owner.code === res.data.data.code)this.owner.id = res.data.data.id;
+                            }else this.owner.id = "";
+                        })
+                },
+                codeSeekOwner(){
+                    this.style = "";
+                    window.axios.post('{{url('customer/project/seekOwner')}}',{code:this.owner.code})
+                        .then(res=>{
+                            if (res.data.success){
+                                if (!this.owner.name){
+                                    this.owner.name = res.data.data.name;
+                                    this.owner.id = res.data.data.id;
+                                    return;
+                                }
+                                if (this.owner.name === res.data.data.name){
+                                    this.owner.id = res.data.data.id;
+                                    return;
+                                }
+                                this.owner.name = res.data.data.name;
+                                this.owner.id = res.data.data.id;
+                                this.style = "border-success";
+                            }else this.owner.id = "";
+                        })
+                },
             },
         });
     </script>

+ 116 - 8
resources/views/customer/project/index.blade.php

@@ -4,16 +4,31 @@
 @section('content')
     @component('customer.project.menu')@endcomponent
     <div class="container-fluid" id="container">
+        <div class="modal fade" tabindex="-1" role="dialog" id="modal">
+            <div class="modal-dialog modal-dialog-scrollable modal-dialog-centered">
+                <div class="modal-content">
+                    <div class="modal-body">
+                        <p>Modal body text goes here.</p>
+                    </div>
+                    <div class="modal-footer">
+                        <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+                    </div>
+                </div>
+            </div>
+        </div>
         <div class="mt-1">
             <button type="button" class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget" :class="[checkData.length>0?'btn-dark text-light':'']"
                     data-toggle="dropdown" title="导出所有页将会以搜索条件得到的筛选结果,将其全部记录(每一页)导出">
                 导出Excel
             </button>
             <div class="dropdown-menu">
-                <a class="dropdown-item" @click="excelExport(false)" href="javascript:">导出勾选内容</a>
-                <a class="dropdown-item" @click="excelExport(true)" href="javascript:">导出所有页</a>
+                <a class="dropdown-item" @click="executeExport(false)" href="javascript:">导出勾选内容</a>
+                <a class="dropdown-item" @click="executeExport(true)" href="javascript:">导出所有页</a>
             </div>
         </div>
+        @if(Session::has('successTip'))
+        <div class="alert alert-success h1">{{Session::get('successTip')}}</div>
+        @endif
         <div>
             <label for="all" id="cloneCheckAll" class="d-none">
                 <input id="all" type="checkbox" @click="checkAll($event)">全选
@@ -21,6 +36,33 @@
             <table class="d-none" id="headerRoll"></table>
             <table class="table table-sm text-nowrap table-striped table-hover" id="headerParent">
                 <tr id="header"></tr>
+                <tr v-for="(owner,i) in owners">
+                    <td>
+                        <label><input type="checkbox" :value="owner.id" v-model="checkData"></label>
+                    </td>
+                    <td>
+                        <a :href="'{{url('customer/project')}}/'+owner.id+'/edit'"><button class="btn btn0sm btn-outline-info">编辑</button></a>
+                    </td>
+                    <td>@{{ owner.customer_name }}</td>
+                    <td>@{{ owner.tax_rate }}</td>
+                    <td>@{{ owner.name }}</td>
+                    <td>@{{ owner.code }}</td>
+                    <td>@{{ owner.contract_number }}</td>
+                    <td>@{{ owner.created_at }}</td>
+                    <td>@{{ owner.salesman }}</td>
+                    <td>@{{ owner.customer_company_name }}</td>
+                    <td>@{{ owner.linkman }}</td>
+                    <td>@{{ owner.phone_number }}</td>
+                    <td>@{{ owner.user_owner_group_name }}</td>
+                    <td>
+                        <button class="btn btn-sm btn-info" @click="showModal(owner)">各项计价</button>
+                    </td>
+                    <td>@{{ owner.owner_storage_price_model_using_type }}</td>
+                    <td>@{{ owner.owner_area_report_accounting_area }}</td>
+                    <td>@{{ owner.waring_line_on }}</td>
+                    <td>@{{ owner.is_activation }}</td>
+                    <td>@{{ owner.description }}</td>
+                </tr>
             </table>
         </div>
     </div>
@@ -28,12 +70,38 @@
 
 @section('lastScript')
     <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>
+    <script type="text/javascript" src="{{mix('js/queryForm/export.js')}}"></script>
     <script>
         let vue = new Vue({
             el:"#container",
             data:{
-                owners : [],
+                owners : [
+                    @foreach($owners as $owner)
+                    {   id : "{{$owner->id}}",
+                        customer_name:"{{$owner->customer ? $owner->customer->name : ''}}",
+                        tax_rate  : "{{$owner->tax_rate}}",
+                        name : "{{$owner->name}}",
+                        code : "{{$owner->code}}",
+                        contract_number : "{{$owner->contract_number}}",
+                        created_at : "{{$owner->created_at}}",
+                        salesman : "{{$owner->salesman}}",
+                        customer_company_name:"{{$owner->customer ? $owner->customer->company_name : ''}}",
+                        linkman:"{{$owner->linkman}}",
+                        phone_number:"{{$owner->phone_number}}",
+                        user_owner_group_name:"{{$owner->userOwnerGroup ? $owner->userOwnerGroup->name : ''}}",
+                        owner_storage_price_model_using_type:"{{ implode(",",array_unique(array_column(($owner->ownerStoragePriceModels)->toArray(),"using_type")))  }}",
+                        owner_area_report_accounting_area : "{{ $owner->ownerAreaReport ? $owner->ownerAreaReport->accounting_area : '' }}",
+                        waring_line_on : "{{$owner->waring_line_on}}",
+                        is_activation : "{{$owner->deleted_at ? '否' : '是'}}",
+                        description : "{{$owner->description}}",
+                        ownerStoragePriceModels : {!! $owner->ownerStoragePriceModels !!},
+                    },
+                    @endforeach
+                ],
                 checkData : [],
+                sum : Number("{{ $owners->total() }}"),
+                priceModel : {},
+                thisClickIndex : "",
             },
             mounted(){
                 let column = [
@@ -72,22 +140,62 @@
                     header.init();
                 },0);
             },
+            watch:{
+                checkData:{
+                    handler(){
+                        if (this.checkData.length === this.owners.length){
+                            document.querySelector('#all').checked = true;
+                            document.querySelector('#all_temp').checked = true;
+                        }else {
+                            document.querySelector('#all').checked = false;
+                            document.querySelector('#all_temp').checked = false;
+                        }
+                    },
+                    deep:true
+                }
+            },
             methods:{
-                excelExport(isAll){
-
+                executeExport(isAll){
+                    let url = '{{url('customer/project/index/export')}}';
+                    let token='{{ csrf_token() }}';
+                    //excelExport 定义在 js/queryForm/export.js
+                    excelExport(isAll,this.checkData,url,this.sum,token);
                 },
                 //全选事件
                 checkAll(e){
                     if (e.target.checked){
+                        this.checkData = [];
                         this.owners.forEach((el)=>{
-                            if (this.checkData.indexOf(el.id) === '-1'){
-                                this.checkData.push(el.id);
-                            }
+                            this.checkData.push(el.id);
                         });
                     }else {
                         this.checkData = [];
                     }
                 },
+                showModal(owner){
+                    if (this.priceModel[owner.id]){
+                        this.thisClickIndex = owner.id;
+                        $("#modal").modal('show');
+                        return;
+                    }
+                    window.axios.post('{{url('customer/project/getOwnerPriceModel')}}',{id:owner.id})
+                        .then(res=>{
+                            if (res.data.success){
+                                let model = res.data.data;
+                                model["ownerStoragePriceModels"] = owner.ownerStoragePriceModels;
+                                delete owner.ownerStoragePriceModels;
+                                this.priceModel[owner.id] = model;
+                                this.thisClickIndex = owner.id;
+                                $("#modal").modal('show');
+                                return;
+                            }
+                            window.tempTip.setDuration(3000);
+                            window.tempTip.showSuccess(res.data.data);
+                        }).catch(err=>{
+                        window.tempTip.setDuration(3000);
+                        window.tempTip.show("网络错误:"+err);
+                    });
+                },
             },
         });
     </script>

+ 1 - 0
resources/views/customer/project/menu.blade.php

@@ -20,6 +20,7 @@
                 <li class="nav-item">
                     <a class="nav-link" href="{{url('customer/project/area')}}" :class="{active:isActive('area',3)}">面积</a>
                 </li> @endcan
+                {{ $slot }}
             </ul>
         </div>
     </div>

+ 13 - 17
resources/views/customer/project/report.blade.php

@@ -32,9 +32,6 @@
                 <tr v-for="(report,i) in reports">
                     <td>
                         <label><input type="checkbox" :value="report.id" v-model="checkData"></label>
-                    </td>
-                    <td>
-
                     </td>
                     <td>@{{ i+1 }}</td>
                     <td>@{{ report.ownerGroupName }}</td>
@@ -128,21 +125,20 @@
                 let column = [
                     {name:'cloneCheckAll',customization:true,type:'checkAll',column:'id',
                         dom:$('#cloneCheckAll').removeClass('d-none'), neglect: true},
-                    {name:'operating',value: '操作', neglect: true},
                     {name:'index',value: '序号', neglect: true ,class:"bg-khaki"},
-                    {name:'workgroup',value: '项目小组',class:"bg-khaki"},
-                    {name:'customer',value: '客户',class:"bg-khaki"},
-                    {name:'owner',value: '子项目',class:"bg-khaki"},
-                    {name:'status',value: '状态',class:"bg-khaki"},
-                    {name:'created_at',value: '创建日期',class:"bg-khaki"},
-                    {name:'storage_duration',value: '在库时长',class:"bg-khaki"},
-                    {name:'counting_month',value: '结算月', class:"bg-info"},
-                    {name:'daily_average_order_amount',value: '日均单量', neglect: true, class:"bg-info"},
-                    {name:'last_month_counting_area',value: '结算月上月盘点面积', neglect: true, class:"bg-info"},
-                    {name:'current_month_counting_area',value: '结算月盘点面积', neglect: true, class:"bg-info"},
-                    {name:'init_bill_amount',value: '初始账单金额', neglect: true, class:"bg-cyanogen"},
-                    {name:'confirm_bill_amount',value: '确认账单金额', neglect: true, class:"bg-cyanogen"},
-                    {name:'confirm_created_at',value: '确认日期', class:"bg-cyanogen"},
+                    {name:'ownerGroupName',value: '项目小组',class:"bg-khaki"},
+                    {name:'customerName',value: '客户',class:"bg-khaki"},
+                    {name:'ownerName',value: '子项目',class:"bg-khaki"},
+                    {name:'ownerStatus',value: '状态',class:"bg-khaki"},
+                    {name:'ownerCreatedAt',value: '创建日期',class:"bg-khaki"},
+                    {name:'ownerStorageDuration',value: '在库时长',class:"bg-khaki"},
+                    {name:'countingMonth',value: '结算月', class:"bg-info"},
+                    {name:'dailyAverageOrderAmount',value: '日均单量', neglect: true, class:"bg-info"},
+                    {name:'lastMonthCountingArea',value: '结算月上月盘点面积', neglect: true, class:"bg-info"},
+                    {name:'currentMonthCountingArea',value: '结算月盘点面积', neglect: true, class:"bg-info"},
+                    {name:'ownerBillReportInitialFee',value: '初始账单金额', neglect: true, class:"bg-cyanogen"},
+                    {name:'ownerBillReportConfirmFee',value: '确认账单金额', neglect: true, class:"bg-cyanogen"},
+                    {name:'ownerBillReportConfirmUpdatedAt',value: '确认日期', class:"bg-cyanogen"},
                 ];
                 let _this=this;
                 setTimeout(function () {

+ 7 - 1
routes/web.php

@@ -497,11 +497,17 @@ Route::group(['prefix'=>'customer'],function(){
         Route::group(['prefix'=>'report'],function(){
             Route::match(['GET','POST'],'export','CustomerController@projectReportExport');
         });
-
+        Route::group(['prefix'=>'index'],function(){
+            Route::match(['GET','POST'],'export','CustomerController@projectIndexExport');
+        });
         Route::get('report','CustomerController@projectReport');
         Route::get('index','CustomerController@projectIndex');
         Route::get('create','CustomerController@projectCreate');
         Route::get('area','CustomerController@projectArea');
+        Route::get('{id}/edit','CustomerController@projectEdit');
+        Route::post('store','CustomerController@projectStore');
+        Route::post('seekOwner','CustomerController@seekOwner');
+        Route::post('getOwnerPriceModel','CustomerController@getOwnerPriceModel');
     });
     Route::group(['prefix'=>'finance'],function(){
         Route::get('instantBill','CustomerController@financeInstantBill');

+ 14 - 21
serves/excelExportGo/api/controller/controller.go

@@ -32,6 +32,8 @@ func Export(w http.ResponseWriter,req *http.Request)  {
 type base struct {
 	ROW []interface{} `json:"row"`
 	LIST [][]interface{} `json:"list"`
+	MERGEROW map[string]string `json:"mergeRow"`
+	MERGECOLUMN []string `json:"mergeColumn"`
 }
 
 func selectCreateFormat(params map[string]string) (row []interface{}, list [][]interface{}, mergeRow map[string]string, mergeColumn []string){
@@ -43,7 +45,7 @@ func selectCreateFormat(params map[string]string) (row []interface{}, list [][]i
 	}
 	return
 }
-//packageStatistic
+
 func selectModule(params map[string]string) (row []interface{}, list [][]interface{}, mergeRow map[string]string, mergeColumn []string) {
 	var data []map[string]string
 	switch params["type"] {
@@ -51,10 +53,12 @@ func selectModule(params map[string]string) (row []interface{}, list [][]interfa
 		var val base
 		err := json.Unmarshal([]byte(params["data"]),&val)
 		if err != nil {
-			utilities.WriteLog("/api/controller/controller.go:53  JSON解析失败!","ERROR")
+			utilities.WriteLog("/api/controller/controller.go:56  JSON解析失败!","ERROR")
 		}
 		row = val.ROW
 		list = val.LIST
+		mergeRow = val.MERGEROW
+		mergeColumn = val.MERGECOLUMN
 	case "waybill":
 		data = orm.GetMysqlData(params["sql"])
 		row, list = WaybillFormat(data)
@@ -95,7 +99,7 @@ func selectModule(params map[string]string) (row []interface{}, list [][]interfa
 		}else{
 			err := json.Unmarshal([]byte(params["data"]), &data)
 			if err != nil {
-				utilities.WriteLog("/api/controller/controller.go:97   库存数据json解析失败!","ERROR")
+				utilities.WriteLog("/api/controller/controller.go:102   库存数据json解析失败!","ERROR")
 			}
 		}
 		row, list = InventoryFormat(data, true)
@@ -105,7 +109,7 @@ func selectModule(params map[string]string) (row []interface{}, list [][]interfa
 		}else{
 			err := json.Unmarshal([]byte(params["data"]), &data)
 			if err != nil {
-				utilities.WriteLog("/api/controller/controller.go:107   全部库存数据json解析失败!","ERROR")
+				utilities.WriteLog("/api/controller/controller.go:112   全部库存数据json解析失败!","ERROR")
 			}
 		}
 		row, list = InventoryFormat(data, false)
@@ -118,14 +122,14 @@ func selectModule(params map[string]string) (row []interface{}, list [][]interfa
 	case "laborReport":
 		err := json.Unmarshal([]byte(params["data"]), &data)
 		if err != nil {
-			utilities.WriteLog("/api/controller/controller.go:121   临时工报表数据json解析失败!","ERROR")
+			utilities.WriteLog("/api/controller/controller.go:125   临时工报表数据json解析失败!","ERROR")
 		}
 		row, list = LaborReportFormat(data)
 	case "orderIssue":
 		sqlList := make(map[string]string)
 		err := json.Unmarshal([]byte(params["sqlList"]), &sqlList)
 		if err != nil {
-			utilities.WriteLog("/api/controller/controller.go:128   订单问题件数据json解析失败!","ERROR")
+			utilities.WriteLog("/api/controller/controller.go:132   订单问题件数据json解析失败!","ERROR")
 		}
 		if sqlList["orderPackageSql"] == "" || sqlList["secondOrderPackageSql"] == "" || sqlList["orderIssueSql"] == "" || sqlList["rejectedBillItemSql"] == "" || sqlList["logSql"] == ""{
 			return
@@ -173,21 +177,10 @@ func selectModule(params map[string]string) (row []interface{}, list [][]interfa
 			"A","B","C","D","E","F","G","H","I","J","K","L",
 			"U","Y","Z","AA","AF","AG","AH","AI","AJ","AK",
 		}
-	case "packageStatistic":
-		type paramList struct {
-			ROW []interface{} `json:"row"`
-			LIST []map[int]string `json:"list"`
-		}
-		request := paramList{}
-		err := json.Unmarshal([]byte(params["data"]), &request)
-		if err != nil {
-			utilities.WriteLog("/api/controller/controller.go:184   称重统计数据json解析失败!","ERROR")
-		}
-		row, list = PackageStatisticFormat(request.ROW, request.LIST)
 	case "inventoryAccountMission":
 		err := json.Unmarshal([]byte(params["data"]), &data)
 		if err != nil {
-			utilities.WriteLog("/api/controller/controller.go:190   库存盘点数据json解析失败!","ERROR")
+			utilities.WriteLog("/api/controller/controller.go:183   库存盘点数据json解析失败!","ERROR")
 		}
 		row, list = InventoryAccountMissionFormat(data)
 	case "inventoryCompare":
@@ -198,16 +191,16 @@ func selectModule(params map[string]string) (row []interface{}, list [][]interfa
 		var rule map[string]string
 		err := json.Unmarshal([]byte(params["row"]), &row)
 		if err != nil {
-			utilities.WriteLog("/api/controller/controller.go:201   参数传递错误!","ERROR")
+			utilities.WriteLog("/api/controller/controller.go:194   参数传递错误!","ERROR")
 		}
 		err = json.Unmarshal([]byte(params["column"]), &column)
 		if err != nil {
-			utilities.WriteLog("/api/controller/controller.go:205   参数传递错误!","ERROR")
+			utilities.WriteLog("/api/controller/controller.go:198   参数传递错误!","ERROR")
 		}
 		if params["mergeColumn"] != ""{
 		    err = json.Unmarshal([]byte(params["mergeColumn"]), &mergeColumn)
             if err != nil {
-                utilities.WriteLog("/api/controller/controller.go:210   参数传递错误!","ERROR")
+                utilities.WriteLog("/api/controller/controller.go:203   参数传递错误!","ERROR")
             }
         }
 		err = json.Unmarshal([]byte(params["rule"]), &rule)

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio