Browse Source

Merge branch 'master' into Haozi

# Conflicts:
#	resources/views/waybill/index.blade.php
haozi 5 years ago
parent
commit
c7c542e683

+ 2 - 2
app/Exceptions/Handler.php

@@ -54,14 +54,14 @@ class Handler extends ExceptionHandler
      */
     public function render($request, Throwable $exception)
     {
-        if ($exception instanceof HttpException) {
+//        if ($exception instanceof HttpException) {
             $code = $exception->getStatusCode();
             switch ($code){
                 case 419:return response()->view('exception.login');
                 case 404:return response()->view('exception.404');
                 default: return response()->view('exception.default',compact('code'));
             }
-        }
+//        }
         return parent::render($request, $exception);
     }
 }

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

@@ -39,7 +39,7 @@ class InventoryController extends Controller
         if ($TOLocation)$sql .= " and TOLocation like '".$TOLocation."%' ";
         if ($SKU)$sql.=" and FMSKU like '".$SKU."%' ";
         $sql.=' group by TOCustomerID, TOLocation,FMSKU,FMLotNum union all ';
-        $sql.=' select /*+INDEX(ACT_Transaction_Log I_ACT_TRANSACTION_LOG_TS)*/ FMLotNum,FMSKU,FMCUSTOMERID 客户,sum(FMQty_Each) as 移出数量, 0 as 移入数量, FMLOCATION as 库位 ';
+        $sql.=' select FMLotNum,FMSKU,FMCUSTOMERID 客户,sum(FMQty_Each) as 移出数量, 0 as 移入数量, FMLOCATION as 库位 ';
         $sql.=" from ACT_Transaction_Log where TransactionType='SO' ";
         if ($date_start) $sql.=" and addtime > to_date('".$date_start." 00:00:00','yyyy-mm-dd hh24:mi:ss') ";
         if ($date_end) $sql.=" and addtime < to_date('".$date_end." 23:59:59','yyyy-mm-dd hh24:mi:ss') ";

+ 31 - 33
app/Http/Controllers/OrderController.php

@@ -14,10 +14,7 @@ use Maatwebsite\Excel\Facades\Excel;
 
 class OrderController extends Controller
 {
-    public function delivering(Request $request){
-        if(!Gate::allows('订单管理-发运')){ return redirect(url('/'));  }
-        $paginate=$request->input('paginate')??50;
-        $page=$request->input('page')??1;
+    private function preciseQuery($request,$sql){
         $ordertime_start=$request->input('ordertime_start');
         $ordertime_end=$request->input('ordertime_end');
         $customerid=$request->input('customerid');
@@ -29,26 +26,7 @@ class OrderController extends Controller
         $issuepartyname=$request->input('issuepartyname');
         $notes=$request->input('notes');
         $addtime=$request->input('addtime');
-        $checkData=$request->input('checkData');
-        $alternate_sku1=$request->input('alternate_sku1');
         $waveno=$request->input('waveno');
-        $export=$request->input('export');
-        $sql="select ACT_ALLOCATION_DETAILS.CHECKTIME,DOC_ORDER_HEADER.addtime,DOC_ORDER_HEADER.C_PROVINCE,DOC_ORDER_HEADER.C_CITY,DOC_ORDER_HEADER.C_DISTRICT,DOC_ORDER_HEADER.C_CONTACT,DOC_ORDER_HEADER.OrderNo,DOC_ORDER_HEADER.SOStatus,DOC_ORDER_HEADER.WAREHOUSEID,DOC_ORDER_HEADER.CustomerID
-        ,DOC_ORDER_HEADER.C_Tel2,DOC_ORDER_HEADER.CarrierName,DOC_ORDER_HEADER.IssuePartyName,
-       DOC_ORDER_HEADER.WaveNo,DOC_ORDER_HEADER.SOReference1
-        ,DOC_ORDER_HEADER.soreference5,DOC_ORDER_HEADER.EDISENDFLAG2,DOC_ORDER_HEADER.EDISendTime2,DOC_ORDER_HEADER.Notes,DOC_ORDER_HEADER.ERPCANCELFLAG,
-       DOC_ORDER_HEADER.Picking_Print_Flag,DOC_ORDER_HEADER.EDISENDFLAG
-        ,DOC_ORDER_HEADER.ReleaseStatus,DOC_ORDER_HEADER.C_Address1,DOC_ORDER_HEADER.OrderTime,DOC_Order_Details.CustomerID,
-       DOC_Order_Details.SKU,DOC_Order_Details.QtyOrdered,DOC_Order_Details.OrderLineNo,BAS_Codes.codename_c,BAS_Customer.descr_c as customer_descr_c,
-       BAS_SKU.Alternate_SKU1,BAS_SKU.Descr_C,(select count(*) from DOC_ORDER_HEADER) as counted
-       from (";
-        if (!$request->input('export')&&!$request->input('export'))$sql.=" select * from (";
-        $sql.=" select ROWNUM as rn,DOC_ORDER_HEADER.addtime,DOC_ORDER_HEADER.C_PROVINCE,DOC_ORDER_HEADER.C_CITY,DOC_ORDER_HEADER.C_DISTRICT,DOC_ORDER_HEADER.C_CONTACT,DOC_ORDER_HEADER.OrderNo,DOC_ORDER_HEADER.SOStatus,DOC_ORDER_HEADER.WAREHOUSEID,DOC_ORDER_HEADER.CustomerID
-                          ,DOC_ORDER_HEADER.C_Tel2,DOC_ORDER_HEADER.CarrierName,DOC_ORDER_HEADER.IssuePartyName,
-                         DOC_ORDER_HEADER.WaveNo,DOC_ORDER_HEADER.SOReference1
-                          ,DOC_ORDER_HEADER.soreference5,DOC_ORDER_HEADER.EDISENDFLAG2,DOC_ORDER_HEADER.EDISendTime2,DOC_ORDER_HEADER.Notes,DOC_ORDER_HEADER.ERPCANCELFLAG,
-                         DOC_ORDER_HEADER.Picking_Print_Flag,DOC_ORDER_HEADER.EDISENDFLAG
-                          ,DOC_ORDER_HEADER.ReleaseStatus,DOC_ORDER_HEADER.C_Address1,DOC_ORDER_HEADER.OrderTime from (select * from DOC_ORDER_HEADER  order by ADDTIME desc )DOC_ORDER_HEADER where 1=1 ";
         if ($ordertime_start)$sql.=" and ordertime>='".$ordertime_start." 00:00:00'";
         if ($ordertime_end)$sql.=" and ordertime<='".$ordertime_end." 23:59:59'";
         if ($customerid)$sql.=" and customerid='".$customerid."'";
@@ -89,6 +67,34 @@ class OrderController extends Controller
                 $sql.=")";
             }
         }
+        return $sql;
+    }
+
+    public function delivering(Request $request){
+        if(!Gate::allows('订单管理-发运')){ return redirect(url('/'));  }
+        $paginate=$request->input('paginate')??50;
+        $page=$request->input('page')??1;
+        $checkData=$request->input('checkData');
+        $alternate_sku1=$request->input('alternate_sku1');
+        $export=$request->input('export');
+        $sql="select ACT_ALLOCATION_DETAILS.CHECKTIME,DOC_ORDER_HEADER.addtime,DOC_ORDER_HEADER.C_PROVINCE,DOC_ORDER_HEADER.C_CITY,DOC_ORDER_HEADER.C_DISTRICT,DOC_ORDER_HEADER.C_CONTACT,DOC_ORDER_HEADER.OrderNo,DOC_ORDER_HEADER.SOStatus,DOC_ORDER_HEADER.WAREHOUSEID,DOC_ORDER_HEADER.CustomerID
+        ,DOC_ORDER_HEADER.C_Tel2,DOC_ORDER_HEADER.CarrierName,DOC_ORDER_HEADER.IssuePartyName,
+       DOC_ORDER_HEADER.WaveNo,DOC_ORDER_HEADER.SOReference1
+        ,DOC_ORDER_HEADER.soreference5,DOC_ORDER_HEADER.EDISENDFLAG2,DOC_ORDER_HEADER.EDISendTime2,DOC_ORDER_HEADER.Notes,DOC_ORDER_HEADER.ERPCANCELFLAG,
+       DOC_ORDER_HEADER.Picking_Print_Flag,DOC_ORDER_HEADER.EDISENDFLAG
+        ,DOC_ORDER_HEADER.ReleaseStatus,DOC_ORDER_HEADER.C_Address1,DOC_ORDER_HEADER.OrderTime,DOC_Order_Details.CustomerID,
+       DOC_Order_Details.SKU,DOC_Order_Details.QtyOrdered,DOC_Order_Details.OrderLineNo,BAS_Codes.codename_c,BAS_Customer.descr_c as customer_descr_c,
+       BAS_SKU.Alternate_SKU1,BAS_SKU.Descr_C,(select count(*) from DOC_ORDER_HEADER WHERE 1=1";
+        $sql=$this->preciseQuery($request,$sql);
+        ;$sql.=" ) as counted from (";
+        if (!$request->input('export')&&!$request->input('export'))$sql.=" select * from (";
+        $sql.=" select ROWNUM as rn,DOC_ORDER_HEADER.addtime,DOC_ORDER_HEADER.C_PROVINCE,DOC_ORDER_HEADER.C_CITY,DOC_ORDER_HEADER.C_DISTRICT,DOC_ORDER_HEADER.C_CONTACT,DOC_ORDER_HEADER.OrderNo,DOC_ORDER_HEADER.SOStatus,DOC_ORDER_HEADER.WAREHOUSEID,DOC_ORDER_HEADER.CustomerID
+                          ,DOC_ORDER_HEADER.C_Tel2,DOC_ORDER_HEADER.CarrierName,DOC_ORDER_HEADER.IssuePartyName,
+                         DOC_ORDER_HEADER.WaveNo,DOC_ORDER_HEADER.SOReference1
+                          ,DOC_ORDER_HEADER.soreference5,DOC_ORDER_HEADER.EDISENDFLAG2,DOC_ORDER_HEADER.EDISendTime2,DOC_ORDER_HEADER.Notes,DOC_ORDER_HEADER.ERPCANCELFLAG,
+                         DOC_ORDER_HEADER.Picking_Print_Flag,DOC_ORDER_HEADER.EDISENDFLAG
+                          ,DOC_ORDER_HEADER.ReleaseStatus,DOC_ORDER_HEADER.C_Address1,DOC_ORDER_HEADER.OrderTime from (select * from DOC_ORDER_HEADER  order by ADDTIME desc )DOC_ORDER_HEADER where 1=1 ";
+        $sql=$this->preciseQuery($request,$sql);
         if ($checkData){
             $checkData=explode(',',$checkData);
             if (count($checkData)>0){
@@ -103,7 +109,7 @@ class OrderController extends Controller
                 $sql.=")";
             }
         }
-        if (!$request->input('export')&&!$request->input('export'))$sql.=" and ROWNUM<='".$page*$paginate."' order by ordertime)";
+        if (!$request->input('export')&&!$request->input('export'))$sql.=" and ROWNUM<='".$page*$paginate."')";
         if (!$request->input('export')&&!$request->input('export'))$sql.=" header where header.rn>'".($page-1)*$paginate."' ";
         $sql.=")DOC_ORDER_HEADER left join DOC_ORDER_DETAILS on DOC_ORDER_DETAILS.ORDERNO=DOC_ORDER_HEADER.ORDERNO
                       left join BAS_CODES on BAS_CODES.CODE=DOC_ORDER_HEADER.sostatus and BAS_CODES.codeid='SO_STS'
@@ -111,14 +117,6 @@ class OrderController extends Controller
                       left join  BAS_SKU on DOC_Order_Details.CustomerID=BAS_SKU.CustomerID and DOC_Order_Details.SKU=BAS_SKU.SKU
                       left join ACT_ALLOCATION_DETAILS on DOC_Order_Details.orderno=ACT_ALLOCATION_DETAILS.orderno and DOC_Order_Details.orderlineno=ACT_ALLOCATION_DETAILS.orderlineno ";
         if ($alternate_sku1)$sql.=" where BAS_SKU.Alternate_SKU1 like '".$alternate_sku1."%'";
-        $sql.=" group by DOC_ORDER_HEADER.addtime,DOC_ORDER_HEADER.C_PROVINCE,DOC_ORDER_HEADER.C_CITY,DOC_ORDER_HEADER.C_DISTRICT,DOC_ORDER_HEADER.C_CONTACT,DOC_ORDER_HEADER.OrderNo,DOC_ORDER_HEADER.SOStatus,DOC_ORDER_HEADER.WAREHOUSEID,DOC_ORDER_HEADER.CustomerID
-        ,DOC_ORDER_HEADER.C_Tel2,DOC_ORDER_HEADER.CarrierName,DOC_ORDER_HEADER.IssuePartyName,
-         DOC_ORDER_HEADER.WaveNo,DOC_ORDER_HEADER.SOReference1
-        ,DOC_ORDER_HEADER.soreference5,DOC_ORDER_HEADER.EDISENDFLAG2,DOC_ORDER_HEADER.EDISendTime2,DOC_ORDER_HEADER.Notes,DOC_ORDER_HEADER.ERPCANCELFLAG,
-         DOC_ORDER_HEADER.Picking_Print_Flag,DOC_ORDER_HEADER.EDISENDFLAG
-        ,DOC_ORDER_HEADER.ReleaseStatus,DOC_ORDER_HEADER.C_Address1,DOC_ORDER_HEADER.OrderTime,DOC_Order_Details.CustomerID,
-         DOC_Order_Details.SKU,DOC_Order_Details.QtyOrdered,DOC_Order_Details.OrderLineNo,
-         BAS_SKU.Alternate_SKU1,BAS_SKU.Descr_C,BAS_Codes.codename_c,BAS_Customer.descr_c,ACT_ALLOCATION_DETAILS.CHECKTIME order by ordertime" ;
         $orders=DB::connection('oracle')->select(DB::raw($sql));
         $commodities=[];
         foreach ($orders as $index=>$order){
@@ -274,7 +272,7 @@ class OrderController extends Controller
                 $mergeCell[$sign[$order->orderno]]=$sign[$order->orderno]+(count($commodities[$order->orderno])-1);
             }
         }
-        $columnName=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","X"];
+        $columnName=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","X","Y","Z","AA"];
         return Excel::download(new Export($row,$list,$mergeCell,$columnName),date('YmdHis', time()).'-出库发运单.xlsx');
     }
 

+ 2 - 2
app/Http/Controllers/ProcessController.php

@@ -537,7 +537,6 @@ class ProcessController extends Controller
             if (count($error)>0)$errors[$processContent['wms_code']]=$error;
         }
         if (count($errors)>0)return ['error'=>$errors];
-
         $process=new Process([
             'code'=>Uuid::uuid1(),
             'owner_id'=>$request->input('owner_id'),
@@ -564,6 +563,7 @@ class ProcessController extends Controller
                     'wms_code'=>$processContent['wms_code'],
                     'amount'=>$processContent['amount'],
                 ]);
+                if ($processContent['is_full'])$processContent->is_full='Y';
                 $processContentOne->save();
                 $this->log(__METHOD__,"录入二次加工单内容单".__FUNCTION__,json_encode($processContentOne),Auth::user()['id']);
             }
@@ -576,7 +576,6 @@ class ProcessController extends Controller
         ]);
         $processStatistic->save();
         $this->log(__METHOD__,"录入二次加工单".__FUNCTION__,json_encode($process)." || ".json_encode($processStatistic),Auth::user()['id']);
-
         if ($request->input('tutorials'))$process->tutorials()->sync($request->input('tutorials'));
         return;
     }
@@ -656,6 +655,7 @@ class ProcessController extends Controller
                         'wms_code'=>$processContent['wms_code'],
                         'amount'=>$processContent['amount'],
                     ]);
+                    if ($processContent['is_full'])$processContentOne->is_full='Y';
                     $processContentOne->save();
                     $this->log(__METHOD__,"录入二次加工单内容单".__FUNCTION__,json_encode($processContentOne),Auth::user()['id']);
                     continue;

+ 17 - 106
app/Http/Controllers/TestController.php

@@ -179,114 +179,25 @@ class TestController extends Controller
             $authority->delete();
         });
     }
-    public function test1(){
-        $waybills=Waybill::select('id','wms_bill_number')->get();
-        foreach ($waybills as $waybill){
-            $orders=WMSWaybillOrder::where('OrderNo',$waybill->wms_bill_number)->get();
-            if (count($orders)>0){
-                $warehouseWeight=0;
-                $sign=false;
-                foreach ($orders as $order){
-                    $warehouseWeight+=$order->Cubic;
-                    if ($order->Cubic==0)$sign=true;
-                }
-                if ($sign)unset($warehouseWeight);
-            }
-            $waybill=Waybill::find($waybill->id);
-            if (isset($warehouseWeight)){
-                if ($waybill){
-                    $waybill->warehouse_weight=$warehouseWeight;
-                }
-            }else{
-                $waybill->warehouse_weight=null;
-                $waybill->warehouse_weight_unit_id=null;
-            }
-            $result+=$temp[$arr[$i]];
-            if ($sign)$sign=false;
-        }
-        if($result<1 || $result>3999)$result=0;
-        return $result;
-    }
-    public function test3()
-    {
-        $strs=["auibh","aopk","bikon"];
-        if (!$strs[0])return "";
-        $len=strlen($strs[0]);
-        for ($i=1;$i<count($strs);$i++){
-            if ($len<1)break;
-            for ($j=0;$j<$len;$j++){
-                if ($strs[$i][$j]!=$strs[0][$j]){
-                    if ($j==0)return "";
-                    break;
-                }
-                $sum=$j+1;
-            }
-            $len=isset($sum)?$sum:0;
-        }
-        return substr($strs[0],0,$len);
-    }
-    public function test4(){
-        $s="{([{()()[]{}}])[{()()[}]{}}](){[]}";
-        $map = [
-            ")" => "(",
-            "}" => "{",
-            "]" => "[",
-        ];
 
-        $len = strlen($s);
-        $stack = [];
-        if ($len%2!=0)dd(false);
-        //s中出现map的key则弹出,没有出现则入栈
-        for ($i =0; $i<$len; $i++) {
-            var_dump("data:".$s[$i]);
-            if (isset($map[$s[$i]])){
-                //s中出现map的key:如果能找到对应的map的值 (,{,[ 则说明有配对,则弹出
-                if (isset($stack)  && $stack[0] == $map[$s[$i]]) {
-                    array_shift($stack);
-                } else { //仅找到后面的一部分,说明是不匹配的
-                    dd(false);
-                }
-                var_dump("value1:".$map[$s[$i]]);
-                var_dump($stack);
-            } else {
-                array_unshift($stack, $s[$i]);
-                var_dump("value2:".$s[$i]);
-                var_dump($stack);
-            }
-        }
+    function test($l1,$l2){
+        if ($l1 === null) return $l2;
+        if ($l2 === null) return $l1;
 
-        if (count($stack) > 0) {
-            dd(false);
+        if ($l1->val < $l2->val) {
+            $l1->next = $this->test($l1->next, $l2);
+            return $l1;
+        } else {
+            $l2->next = $this->test($l1, $l2->next);
+            return $l2;
         }
-        dd(true);
-        //利用栈的先进后出 一个正确的括号组对应都为1对1或N对N
-        // 先进后出“([{”入栈,")]}"出栈,轮询到出栈元素去映射栈顶,符合出栈,不符合直接返回
-        //依次轮询 如果映射正确那么最后栈为空栈 否则返回false
-
-        /*
-        $r=[];
-        $sTemp=["("=>1,"["=>2,"{"=>3,")"=>-1,"]"=>-2,"}"=>-3];
-        for ($i=0;$i<strlen($s);$i++){
-            if ($i!=strlen($s)-1){
-                if (($sTemp[$s[$i]]+$sTemp[$s[$i+1]])==0){
-                    $i++;
-                    var_dump($s[$i],$i);
-                    continue;
-                }
-            }
-            array_push($r,$sTemp[$s[$i]]);
-        }
-        $sum=count($r);
-        if ($sum==0)return "a";
-        if ($sum%2!=0)return "b";
-        $svg=$sum/2;
-        for ($i=0;$i<$svg;$i++){
-            if ($r[$i]>0&&$r[$i]+$r[$sum-1-$i]!=0)return "b";
-        }
-        return "a";*/
-    }
-    function test(){
-        $waybill=Waybill::with('uploadFile')->find(55);
-        dd($waybill,$waybill->upload_file_url);
     }
 }
+class ListNode {
+    public $val = 0;
+    public $next = null;
+    function __construct($val = 0, $next = null) {
+        $this->val = $val;
+        $this->next = $next;
+    }
+}

+ 1 - 1
app/ProcessesContent.php

@@ -9,7 +9,7 @@ class ProcessesContent extends Model
 {
     use ModelTimeFormat;
     protected $fillable=[
-        'process_id','bill_type','commodity_id','wms_code','amount'
+        'process_id','bill_type','commodity_id','wms_code','amount','is_full'
     ];
     protected $appends=[
         'commodity_name',

+ 84 - 0
composer.lock

@@ -111,6 +111,12 @@
                 "brick",
                 "math"
             ],
+            "funding": [
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/brick/math",
+                    "type": "tidelift"
+                }
+            ],
             "time": "2020-04-15T15:59:35+00:00"
         },
         {
@@ -400,6 +406,20 @@
                 "sqlserver",
                 "sqlsrv"
             ],
+            "funding": [
+                {
+                    "url": "https://www.doctrine-project.org/sponsorship.html",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://www.patreon.com/phpdoctrine",
+                    "type": "patreon"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal",
+                    "type": "tidelift"
+                }
+            ],
             "time": "2020-04-20T17:19:26+00:00"
         },
         {
@@ -920,6 +940,12 @@
                 "flare",
                 "reporting"
             ],
+            "funding": [
+                {
+                    "url": "https://www.patreon.com/spatie",
+                    "type": "patreon"
+                }
+            ],
             "time": "2020-03-02T15:52:04+00:00"
         },
         {
@@ -2129,6 +2155,16 @@
                 "php",
                 "phpspreadsheet"
             ],
+            "funding": [
+                {
+                    "url": "https://laravel-excel.com/commercial-support",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/patrickbrouwers",
+                    "type": "github"
+                }
+            ],
             "time": "2020-02-28T15:47:45+00:00"
         },
         {
@@ -2871,6 +2907,12 @@
                 "Pinyin",
                 "cn2pinyin"
             ],
+            "funding": [
+                {
+                    "url": "https://www.patreon.com/overtrue",
+                    "type": "patreon"
+                }
+            ],
             "time": "2020-04-13T08:53:30+00:00"
         },
         {
@@ -3845,6 +3887,12 @@
                 "identifier",
                 "uuid"
             ],
+            "funding": [
+                {
+                    "url": "https://github.com/ramsey",
+                    "type": "github"
+                }
+            ],
             "time": "2020-03-29T20:13:32+00:00"
         },
         {
@@ -3920,6 +3968,12 @@
                 "highlight.php",
                 "syntax"
             ],
+            "funding": [
+                {
+                    "url": "https://github.com/allejo",
+                    "type": "github"
+                }
+            ],
             "time": "2020-03-02T05:59:21+00:00"
         },
         {
@@ -6915,6 +6969,16 @@
                 "oracle",
                 "pdo_oci"
             ],
+            "funding": [
+                {
+                    "url": "https://www.paypal.me/yajra",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://www.patreon.com/yajra",
+                    "type": "patreon"
+                }
+            ],
             "time": "2020-03-04T02:15:19+00:00"
         },
         {
@@ -7038,6 +7102,12 @@
                 "profiler",
                 "webprofiler"
             ],
+            "funding": [
+                {
+                    "url": "https://github.com/barryvdh",
+                    "type": "github"
+                }
+            ],
             "time": "2020-05-05T10:53:32+00:00"
         },
         {
@@ -7559,6 +7629,20 @@
                 "php",
                 "symfony"
             ],
+            "funding": [
+                {
+                    "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/nunomaduro",
+                    "type": "github"
+                },
+                {
+                    "url": "https://www.patreon.com/nunomaduro",
+                    "type": "patreon"
+                }
+            ],
             "time": "2020-04-04T19:56:08+00:00"
         },
         {

+ 32 - 0
database/migrations/2020_06_22_145927_change_processes_contents_add_column_is_full.php

@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class ChangeProcessesContentsAddColumnIsFull extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('processes_contents',function (Blueprint $table){
+            $table->string('is_full',2)->default('N')->comment('是否成品');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('processes_contents',function (Blueprint $table) {
+            $table->dropColumn('is_full');
+        });
+    }
+}

File diff suppressed because it is too large
+ 216 - 342
public/js/app.js


+ 7 - 4
resources/views/order/index/delivering.blade.php

@@ -373,15 +373,18 @@
                             tempTip.showSuccess('没有勾选任何记录')
                             return;
                         }
-                        window.location.href="{{url('order/index/delivering?checkData=')}}"+this.checkData;
+                        window.open("{{url('order/index/delivering?checkData=')}}"+this.checkData);
                         return;
                     }
-                    window.location.href="{{url('order/index/delivering?ordertime_start=')}}"+this.filterData.ordertime_start
+                    if (this.sum>10000){
+                        if (!confirm("需要导出的条数超过了一万条,等待时间较长,是否继续?"))return;
+                    }
+                    window.open("{{url('order/index/delivering?ordertime_start=')}}"+this.filterData.ordertime_start
                         +"&&ordertime_end="+this.filterData.ordertime_end+"&&orderno="+this.filterData.orderno
                         +"&&soreference5="+this.filterData.soreference5+"&&export="+true+"&&codename_c="+this.filterData.codename_c
-                        +"&&issuepartyname="+this.filterData.issuepartyname+"&&carriername="+this.filterData.carriername
+                        +"&&issuepartyname="+this.filterData.issuepartyname+"&&customerid="+this.filterData.customerid
                         +"&&soreference1="+this.filterData.soreference1+"&&notes="+this.filterData.notes
-                        +"&&addtime="+this.filterData.addtime+"&&alternate_sku1="+this.filterData.alternate_sku1+"&&waveno="+this.filterData.waveno;
+                        +"&&addtime="+this.filterData.addtime+"&&alternate_sku1="+this.filterData.alternate_sku1+"&&waveno="+this.filterData.waveno);
                 },
                 modal(){
                     $("#myModal").modal('show');

+ 166 - 65
resources/views/process/create.blade.php

@@ -7,70 +7,159 @@
     <div class="container-fluid" id="list">
         <div class="card col-md-8 offset-md-2">
             <div class="card-body">
-                <div class="form-group row">
-                    <label class="col-3 col-form-label text-right" >单据号</label>
-                    <input v-model="process.wms_code" class="form-control col-6 " :class="error.wms_code && error.wms_code.length>0 ? 'is-invalid' :''">&nbsp;&nbsp;&nbsp;
-                    <input class="btn btn-info col-2" type="button" @click="addProcessContent()" value="新增库单据">
-                    <span v-if="error.wms_code && error.wms_code.length>0" class="invalid-feedback col-8 offset-3 mt-0" role="alert">
-                        <strong>@{{ error.wms_code[0] }}</strong>
-                    </span>
-                </div>
-                <div class="form-group row" v-if="processContents.length>0" v-for="processContent in processContents" >
-                    <div class="col-8 offset-md-3 pl-0 pt-2 border  rounded" :style="processContent.addBtnShow?'': 'opacity:0.88;background-color:#f5f5f5;transform:scale(0.9)'">
-                        <div class="row pt-2">
-                            <label class="col-3 col-form-label text-right">单据号@{{ processContent.i }}</label>
-                            <b class="col-8">@{{ processContent.wms_code }}</b>
-                        </div>
-                        <div class="row pt-2" v-if="processContent.addBtnShow">
-                            <label class="col-3 col-form-label text-right">选择商品</label>
-                            <span class=" col-9 input-group" style="max-height: 150px; overflow-y: scroll;border-radius:5px;opacity:1.5;text-align: center;">
-                                <ul class="list-group tooltipTarget" title="双击选择商品" style="width: 100%" onselectstart="return false;">
-                                    <li v-for="commodity in processContent.commodities" :id="commodity.id" class="list-group-item list-group-item-action p-0 m-0"
-                                        @dblclick="selectedCommodity(commodity,processContent.wms_code)" :class="processContent.commodity_id && processContent.commodity_id==commodity.id && processContent.lineNo==commodity.lineNo? 'active' :''">
-                                        <p class="form-inline" style="cursor: default;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"><small style="overflow: hidden;" :title="commodity.name" class="text-left text-info col-6">@{{ commodity.name }}</small>
-                                            <small class="text-left  col-6" style="overflow: hidden;">
-                                                <a v-for="barcode in commodity.barcodes">@{{ barcode.code }}&nbsp;&nbsp;&nbsp;</a>
-                                            </small></p></li>
-                                </ul>
-                            </span>
+                <div class="row">
+                    <div class="col-6  rounded mb-2 border" style="background: #efe3d9;">
+                        <div class="form-group row mt-2">
+                            <label class="col-2 text-right mt-2">原料单据</label>
+                            <input class="form-control col-7" v-model="process.wms_code">&nbsp;&nbsp;&nbsp;
+                            <button class="btn btn-info btn-sm col-2"  type="button" @click="addProcessContent(false)"> 新增库单据</button>
                         </div>
-                        <div class="row pt-2">
-                            <label class="col-3 col-form-label text-right">商品名</label>
-                            <b  class="col-8">@{{ processContent.commodity_name }}</b>
+                        <div class="form-group row">
+                            <div class="col-10 offset-1 pl-0 pt-2 border rounded bg-light">
+                                <div class="row pt-2 small"><label class="col-3 text-right" >单据号</label>
+                                    <b class="col-8" v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].is_full">@{{ processContents[0].wms_code }}</b></div> <!---->
+                                <div class="row pt-2" v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].is_full">
+                                    <span class="col-12 text-center text-muted small">双击选择商品:</span>
+                                    <span class=" col-11 offset-1 input-group" style=" border-radius: 5px; opacity: 1.5; text-align: center;">
+                                        <ul onselectstart="return false;" class="list-group tooltipTarget" style="width: 100%; max-height: 130px; overflow-y: scroll;">
+                                            <li  v-for="commodity in processContents[0].commodities" :id="commodity.id"  :style="{'background-color':processContents[0].commodity_id==commodity.id ? '#9fcdff':''}"
+                                                @dblclick="selectedCommodity(commodity,processContents[0].wms_code)" class="list-group-item list-group-item-action p-0 m-0">
+                                                <div class="form-inline" style="cursor: default; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
+                                                    <small :title="commodity.name" class="text-left text-primary col-6 tooltipTarget"  style="overflow: hidden;">@{{ commodity.name }}</small>
+                                                    <small class="text-left  col-6"><a v-for="barcode in commodity.barcodes">@{{ barcode.code }}&nbsp;&nbsp;&nbsp;</a></small>
+                                                </div>
+                                            </li>
+                                        </ul>
+                                    </span>
+                                </div>
+                                <div class="row pt-2 small"><label class="col-3  text-right">商品名</label>
+                                    <b v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].is_full" class="col-8">@{{ processContents[0].commodity_name }}</b>
+                                </div>
+                                <div class="row pt-2 small"><label class="col-3  text-right">条码</label>
+                                    <ul class="p-0 m-0 ml-2 list-unstyled list-inline" v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].is_full && processContents[0].commodity_barcodes && processContents[0].commodity_barcodes.length>0">
+                                        <li v-for="barcode in processContents[0].commodity_barcodes"><small>&nbsp;&nbsp;@{{ barcode.code }}</small></li>
+                                    </ul>
+                                </div>
+                                <div class="row pt-2 small"><label class="col-3  text-right">SKU</label>
+                                    <b v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].is_full" class="col-8">@{{ processContents[0].commodity_sku }}</b></div>
+                                <div class="row pt-2 small"><label class="col-3  text-right">单据类型</label>
+                                    <select v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].is_full"
+                                            v-model="processContents[0].bill_type"  class="col-8 form-control form-control-sm">
+                                        <option value="移库单">移库单</option>
+                                        <option value="入库单">入库单</option>
+                                        <option value="出库单">出库单</option>
+                                    </select></div>
+                                <div class="row pt-2 small"><label class="col-3  text-right">数量</label>
+                                    <input v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].is_full" v-model="processContents[0].amount" type="text" class="form-control form-control-sm col-8">
+                                </div>
+                                <div class="col-8 offset-2 pt-2 pb-2">
+                                    <input type="button" v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].is_full"
+                                           @click="confirmStore(processContents[0].wms_code,processContents[0].commodity_id,processContents[0].amount)"
+                                           value="确定新增" class="btn btn-primary btn-sm form-control form-control-sm">
+                                </div>
+                                <div class="col-8 offset-2 pt-2 pb-2">
+                                    <input v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].is_full" type="button" @click="deleteProcessContent(processContents[0].wms_code)" value="删除" class="btn btn-danger form-control">
+                                </div>
+                            </div>
                         </div>
-                        <div class="row pt-2">
-                            <label class="col-3 col-form-label text-right">条码</label>
-                            <ul class="p-0 m-0 ml-3 list-unstyled list-inline" v-if="processContent.commodity_barcodes && processContent.commodity_barcodes.length>0">
-                                <li v-for="barcode in processContent.commodity_barcodes"><small>@{{ barcode.code }}</small></li>
-                            </ul>
+                        <div class="form-group row">
+                            <div class="col-10 offset-1 p-1 border rounded bg-light" v-for="processContent in processContents" v-if="!processContent.addBtnShow && !processContent.is_full">
+                                <div class="col-12 border">
+                                    <div class="row small"  @mouseover="update_delBtn(true,processContent.wms_code,processContent.commodity_id)" @mouseleave="update_delBtn(false,processContent.wms_code,processContent.commodity_id)">
+                                        <span class="font-weight-bold">单据号:</span>
+                                        <span class="font-weight-bold">@{{ processContent.wms_code }}</span>
+                                        <span class="ml-2 text-muted">单据类型:</span>
+                                        <span class=" text-muted">@{{ processContent.bill_type }}</span>
+                                        <span class="ml-2 font-weight-bold">商品名:</span>
+                                        <span class="font-weight-bold">@{{ processContent.commodity_name }}</span>
+                                        <span class="ml-2 text-muted">SKU:</span>
+                                        <span class=" text-muted">@{{ processContent.commodity_sku }}</span>
+                                        <span class="ml-2 font-weight-bold">数量:</span>
+                                        <span class="font-weight-bold">@{{ processContent.amount }}</span>
+                                        <span class="ml-2 text-muted">条码:</span>
+                                        <span class="text-muted"><small v-if="processContent.commodity_barcodes && processContent.commodity_barcodes.length>0"
+                                                                        v-for="barcode in processContent.commodity_barcodes">@{{ barcode.code }}</small></span>
+                                        <button v-if="is_delBtn[processContent.wms_code+'_'+processContent.commodity_id]" @click="deleteProcessContent(processContent.wms_code,processContent.commodity_id)" class="btn btn-sm btn-danger" style="position: absolute;right: 0;bottom: 0">删除</button>
+                                    </div>
+                                </div>
+                            </div>
                         </div>
-
-                        <div class="row pt-2">
-                            <label class="col-3 col-form-label text-right">SKU</label>
-                            <b  class="col-8">@{{ processContent.commodity_sku }}</b>
-                        </div>
-                        <div class="row pt-2">
-                            <label class="col-3 col-form-label text-right">单据类型</label>
-                            <select  disabled v-model="processContent.bill_type" class="col-8 form-control"
-                                     :class="processContentError[processContent.wms_code] && processContentError[processContent.wms_code].bill_type ? 'is-invalid' :''">
-                                <option value="移库单">移库单</option>
-                                <option value="入库单">入库单</option>
-                                <option value="出库单">出库单</option>
-                            </select>
-                        </div>
-                        <div  class="row pt-2">
-                            <label class="col-3 col-form-label text-right">数量</label>
-                            <input :readonly="!processContent.addBtnShow" v-model="processContent.amount" type="text" class="form-control col-8"
-                                   :class="processContentError[processContent.wms_code] && processContentError[processContent.wms_code].amount ? 'is-invalid' :''">
-                            <span v-if="processContentError[processContent.wms_code] && processContentError[processContent.wms_code].amount" class="invalid-feedback col-8 offset-3 mt-0" role="alert">
-                                <strong>@{{ processContentError[processContent.wms_code].amount[0] }}</strong>
-                            </span>
+                    </div>
+                    <div class="col-6 rounded mb-2 border" style="background: #ccd7dc;">
+                        <div class="form-group row mt-2">
+                            <label class="col-2 text-right mt-2">成品单据</label>
+                            <input class="form-control col-7" v-model="process.wms_code_full">&nbsp;&nbsp;&nbsp;
+                            <button class="btn btn-info btn-sm col-2"  type="button" @click="addProcessContent(true)"> 新增库单据</button>
                         </div>
-                        <div class="col-8 offset-2 pt-2" v-if="processContent.addBtnShow">
-                            <input type="button" @click="confirmStore(processContent.wms_code,processContent.commodity_id,processContent.amount)" value="确定新增" class="btn btn-primary form-control">
+                        <div class="form-group row">
+                            <div class="col-10 offset-1 pl-0 pt-2 border rounded bg-light">
+                                <div class="row pt-2 small"><label class="col-3 text-right" >单据号</label>
+                                    <b class="col-8" v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].is_full">@{{ processContents[0].wms_code }}</b></div> <!---->
+                                <div class="row pt-2" v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].is_full">
+                                    <span class="col-12 text-center text-muted small">双击选择商品:</span>
+                                    <span class=" col-11 offset-1 input-group" style=" border-radius: 5px; opacity: 1.5; text-align: center;">
+                                        <ul onselectstart="return false;" class="list-group tooltipTarget" style="width: 100%; max-height: 130px; overflow-y: scroll;">
+                                            <li  v-for="commodity in processContents[0].commodities" :id="commodity.id" :style="{'background-color':processContents[0].commodity_id==commodity.id ? '#9fcdff':''}"
+                                                 @dblclick="selectedCommodity(commodity,processContents[0].wms_code)" class="list-group-item list-group-item-action p-0 m-0">
+                                                <div class="form-inline" style="cursor: default; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
+                                                    <small :title="commodity.name" class="text-left text-info col-6" style="overflow: hidden;">@{{ commodity.name }}</small>
+                                                    <small class="text-left  col-6"><a v-for="barcode in commodity.barcodes">@{{ barcode.code }}&nbsp;&nbsp;&nbsp;</a></small>
+                                                </div>
+                                            </li>
+                                        </ul>
+                                    </span>
+                                </div>
+                                <div class="row pt-2 small"><label class="col-3  text-right">商品名</label>
+                                    <b v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].is_full" class="col-8">@{{ processContents[0].commodity_name }}</b>
+                                </div>
+                                <div class="row pt-2 small"><label class="col-3  text-right">条码</label>
+                                    <ul class="p-0 m-0 ml-2 list-unstyled list-inline" v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].is_full && processContents[0].commodity_barcodes && processContents[0].commodity_barcodes.length>0">
+                                        <li v-for="barcode in processContents[0].commodity_barcodes"><small>&nbsp;&nbsp;@{{ barcode.code }}</small></li>
+                                    </ul>
+                                </div>
+                                <div class="row pt-2 small"><label class="col-3  text-right">SKU</label>
+                                    <b v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].is_full" class="col-8">@{{ processContents[0].commodity_sku }}</b></div>
+                                <div class="row pt-2 small"><label class="col-3  text-right">单据类型</label>
+                                    <select v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].is_full"
+                                            v-model="processContents[0].bill_type"  class="col-8 form-control form-control-sm">
+                                        <option value="移库单">移库单</option>
+                                        <option value="入库单">入库单</option>
+                                        <option value="出库单">出库单</option>
+                                    </select></div>
+                                <div class="row pt-2 small"><label class="col-3  text-right">数量</label>
+                                    <input v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].is_full" v-model="processContents[0].amount" type="text" class="form-control form-control-sm col-8">
+                                </div>
+                                <div class="col-8 offset-2 pt-2 pb-2">
+                                    <input type="button" v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].is_full"
+                                           @click="confirmStore(processContents[0].wms_code,processContents[0].commodity_id,processContents[0].amount)"
+                                           value="确定新增" class="btn btn-primary btn-sm form-control form-control-sm">
+                                </div>
+                                <div class="col-8 offset-2 pt-2 pb-2">
+                                    <input v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].is_full" type="button" @click="deleteProcessContent(processContents[0].wms_code)" value="删除" class="btn btn-danger form-control">
+                                </div>
+                            </div>
                         </div>
-                        <div class="col-8 offset-2 pt-2 pb-2">
-                            <input type="button" @click="deleteProcessContent(processContent.wms_code)" value="删除" class="btn btn-danger form-control">
+                        <div class="form-group row">
+                            <div class="col-10 offset-1 p-1 border rounded bg-light" v-for="processContent in processContents" v-if="!processContent.addBtnShow && processContent.is_full">
+                                <div class="col-12 border">
+                                    <div class="row small" style="position: relative" @mouseover="update_delBtn(true,processContent.wms_code,processContent.commodity_id)" @mouseleave="update_delBtn(false,processContent.wms_code,processContent.commodity_id)">
+                                        <span class="font-weight-bold">单据号:</span>
+                                        <span class="font-weight-bold">@{{ processContent.wms_code }}</span>
+                                        <span class="ml-2 text-muted">单据类型:</span>
+                                        <span class=" text-muted">@{{ processContent.bill_type }}</span>
+                                        <span class="ml-2 font-weight-bold">商品名:</span>
+                                        <span class="font-weight-bold">@{{ processContent.commodity_name }}</span>
+                                        <span class="ml-2 text-muted">SKU:</span>
+                                        <span class=" text-muted">@{{ processContent.commodity_sku }}</span>
+                                        <span class="ml-2 font-weight-bold">数量:</span>
+                                        <span class="font-weight-bold">@{{ processContent.amount }}</span>
+                                        <span class="ml-2 text-muted">条码:</span>
+                                        <span class="text-muted"><small v-if="processContent.commodity_barcodes && processContent.commodity_barcodes.length>0"
+                                                                        v-for="barcode in processContent.commodity_barcodes">@{{ barcode.code }}</small></span>
+                                        <button v-if="is_delBtn[processContent.wms_code+'_'+processContent.commodity_id]" @click="deleteProcessContent(processContent.wms_code,processContent.commodity_id)" class="btn btn-sm btn-danger" style="position: absolute;right: 0;bottom: 0">删除</button>
+                                    </div>
+                                </div>
+                            </div>
                         </div>
                     </div>
                 </div>
@@ -134,7 +223,7 @@
         let vueList=new Vue({
             el:'#list',
             data:{
-                process:{wms_code:'',owner_id:'',process_method_id:'',unit_price:'',remark:'',amount:''},
+                process:{wms_code:'',owner_id:'',process_method_id:'',unit_price:'',remark:'',amount:'',wms_code_full:''},
                 error:{wms_code:[],owner_id:[],process_method_id:[],unit_price:[],amount:[]},
                 processContentError:[],
                 processContents:[],
@@ -147,7 +236,7 @@
                 selectedTutorials:[],
                 msg:false,
                 commodityIds:[],
-
+                is_delBtn:[],
             },
             watch:{
                 processContents:{
@@ -164,9 +253,10 @@
             },
             methods:{
                 //新增库单据
-                addProcessContent(){
+                addProcessContent(is_full){
                     let _this=this;
                     let wms_code=_this.process.wms_code;
+                    if (is_full) wms_code=_this.process.wms_code_full;
                     if (!wms_code){
                         tempTip.setDuration(3000);
                         tempTip.show('未输入单据号!');
@@ -219,6 +309,7 @@
                             processContent['amount']='';
                             processContent['lineNo']='';
                             processContent['addBtnShow']=true;
+                            processContent['is_full']=is_full;
                             _this.processContents.unshift(processContent);
                         }).catch(function (err) {
                         if (_this.msg)_this.msg=false;
@@ -239,6 +330,11 @@
                         tempTip.show("尚未填写数量!");
                         return;
                     }
+                    if (isNaN(amount)) {
+                        tempTip.setDuration(2000);
+                        tempTip.show("数量必须为数字!");
+                        return;
+                    }
                     let _this=this;
                     _this.processContents.every(function (processContent) {
                         if (processContent.wms_code==wms_code) {
@@ -250,10 +346,10 @@
                     });
                 },
                 //删除新增
-                deleteProcessContent(wms_code){
+                deleteProcessContent(wms_code,commodity_id){
                     let _this=this;
                     _this.processContents.every(function (processContent,i) {
-                        if (processContent.wms_code==wms_code) {
+                        if (processContent.wms_code===wms_code&&processContent.commodity_id===commodity_id) {
                             _this.processContents.splice(i,1);
                             _this.commodityIds.splice(_this.commodityIds.indexOf(processContent.commodity_id),1);
                             return false;
@@ -381,7 +477,12 @@
                     if (this.processContents.length>=1 && this.processContents[(this.processContents.length)-1].owner_id){
                         this.getTutorial(this.processContents[(this.processContents.length)-1].owner_id);
                     }
-                }
+                },
+                //删除按钮的显示
+                update_delBtn(type,wms_code,commodity_id){
+                    if (type) this.$set(this.is_delBtn,wms_code+'_'+commodity_id,true);
+                    else this.$set(this.is_delBtn,wms_code+'_'+commodity_id,false);
+                },
             },
         });
     </script>

+ 167 - 69
resources/views/process/edit.blade.php

@@ -11,80 +11,169 @@
     <div class="container-fluid" id="list">
         <div class="card col-md-8 offset-md-2">
             <div class="card-body">
-                <div class="form-group row">
-                    <label class="col-3 col-form-label text-right" >单据号</label>
-                    <input v-model="process.wms_code" class="form-control col-6" :class="error.wms_code && error.wms_code.length>0 ? 'is-invalid' :''">&nbsp;&nbsp;&nbsp;
-                    <input class="btn btn-info col-2" type="button" @click="addProcessContent()" value="新增库单据">
-                    <span v-if="error.wms_code && error.wms_code.length>0" class="invalid-feedback col-8 offset-3 mt-0" role="alert">
-                        <strong>@{{ error.wms_code[0] }}</strong>
-                    </span>
-                </div>
-                <div class="form-group row">
-                    <label class="col-3 col-form-label text-right" >任务号</label>
-                    <input disabled :value="process.code" class="form-control col-8">
-                </div>
-                <div class="form-group row" v-if="processContents.length>0" v-for="processContent in processContents">
-                    <div class="col-8 offset-md-3 pl-0 pt-2 border  rounded">
-                        <div class="row pt-2">
-                            <label class="col-3 col-form-label text-right">单据号@{{ processContent.i }}</label>
-                            <b class="col-8">@{{ processContent.wms_code }}</b>
+                <div class="row">
+                    <div class="col-6  rounded mb-2 border" style="background: #efe3d9;">
+                        <div class="form-group row mt-2">
+                            <label class="col-2 text-right mt-2">原料单据</label>
+                            <input class="form-control col-7" v-model="process.wms_code">&nbsp;&nbsp;&nbsp;
+                            <button class="btn btn-info btn-sm col-2"  type="button" @click="addProcessContent(false)"> 新增库单据</button>
                         </div>
-                        <div class="row pt-2" v-if="processContent.addBtnShow">
-                            <label class="col-3 col-form-label text-right">选择商品</label>
-                            <span class=" col-9 input-group" style="max-height: 150px; overflow-y: scroll;border-radius:5px;opacity:1.5;text-align: center;">
-                                <ul class="list-group tooltipTarget" title="双击选择商品" style="width: 100%" onselectstart="return false;">
-                                    <li v-for="commodity in processContent.commodities" :id="commodity.id" class="list-group-item list-group-item-action p-0 m-0"
-                                         @dblclick="selectedCommodity(commodity,processContent.wms_code)" :class="processContent.commodity_id==commodity.id ? 'active' :''">
-                                        <p class="form-inline" style="cursor: default;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"><small style="overflow: hidden;" :title="commodity.name" class="text-left text-info col-6">@{{ commodity.name }}</small>
-                                            <small class="text-left  col-6" >
-                                                <a v-for="barcode in commodity.barcodes">@{{ barcode.code }}&nbsp;&nbsp;&nbsp;</a>
-                                            </small></p></li>
-                                </ul>
-                            </span>
+                        <div class="form-group row">
+                            <div class="col-10 offset-1 pl-0 pt-2 border rounded bg-light">
+                                <div class="row pt-2 small"><label class="col-3 text-right" >单据号</label>
+                                    <b class="col-8" v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].is_full">@{{ processContents[0].wms_code }}</b></div> <!---->
+                                <div class="row pt-2" v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].is_full">
+                                    <span class="col-12 text-center text-muted small">双击选择商品:</span>
+                                    <span class=" col-11 offset-1 input-group" style=" border-radius: 5px; opacity: 1.5; text-align: center;">
+                                        <ul onselectstart="return false;" class="list-group tooltipTarget" style="width: 100%; max-height: 130px; overflow-y: scroll;">
+                                            <li  v-for="commodity in processContents[0].commodities" :id="commodity.id"  :style="{'background-color':processContents[0].commodity_id==commodity.id ? '#9fcdff':''}"
+                                                 @dblclick="selectedCommodity(commodity,processContents[0].wms_code)" class="list-group-item list-group-item-action p-0 m-0">
+                                                <div class="form-inline" style="cursor: default; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
+                                                    <small :title="commodity.name" class="text-left text-primary col-6 tooltipTarget"  style="overflow: hidden;">@{{ commodity.name }}</small>
+                                                    <small class="text-left  col-6"><a v-for="barcode in commodity.barcodes">@{{ barcode.code }}&nbsp;&nbsp;&nbsp;</a></small>
+                                                </div>
+                                            </li>
+                                        </ul>
+                                    </span>
+                                </div>
+                                <div class="row pt-2 small"><label class="col-3  text-right">商品名</label>
+                                    <b v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].is_full" class="col-8">@{{ processContents[0].commodity_name }}</b>
+                                </div>
+                                <div class="row pt-2 small"><label class="col-3  text-right">条码</label>
+                                    <ul class="p-0 m-0 ml-2 list-unstyled list-inline" v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].is_full && processContents[0].commodity_barcodes && processContents[0].commodity_barcodes.length>0">
+                                        <li v-for="barcode in processContents[0].commodity_barcodes"><small>&nbsp;&nbsp;@{{ barcode.code }}</small></li>
+                                    </ul>
+                                </div>
+                                <div class="row pt-2 small"><label class="col-3  text-right">SKU</label>
+                                    <b v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].is_full" class="col-8">@{{ processContents[0].commodity_sku }}</b></div>
+                                <div class="row pt-2 small"><label class="col-3  text-right">单据类型</label>
+                                    <select v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].is_full"
+                                            v-model="processContents[0].bill_type"  class="col-8 form-control form-control-sm">
+                                        <option value="移库单">移库单</option>
+                                        <option value="入库单">入库单</option>
+                                        <option value="出库单">出库单</option>
+                                    </select></div>
+                                <div class="row pt-2 small"><label class="col-3  text-right">数量</label>
+                                    <input v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].is_full" v-model="processContents[0].amount" type="text" class="form-control form-control-sm col-8">
+                                </div>
+                                <div class="col-8 offset-2 pt-2 pb-2">
+                                    <input type="button" v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].is_full"
+                                           @click="confirmStore(processContents[0].wms_code,processContents[0].commodity_id,processContents[0].amount)"
+                                           value="确定新增" class="btn btn-primary btn-sm form-control form-control-sm">
+                                </div>
+                                <div class="col-8 offset-2 pt-2 pb-2">
+                                    <input v-if="processContents.length>0 && processContents[0].addBtnShow && !processContents[0].is_full" type="button" @click="deleteProcessContent(processContents[0])" value="删除" class="btn btn-danger form-control">
+                                </div>
+                            </div>
                         </div>
-                        <div class="row pt-2">
-                            <label class="col-3 col-form-label text-right">商品名</label>
-                            <b  class="col-8">@{{ processContent.commodity_name }}</b>
+                        <div class="form-group row">
+                            <div class="col-10 offset-1 p-1 border rounded bg-light" v-for="processContent in processContents" v-if="!processContent.addBtnShow && !processContent.is_full">
+                                <div class="col-12 border">
+                                    <div class="row small"  @mouseover="update_delBtn(true,processContent.wms_code,processContent.commodity_id)" @mouseleave="update_delBtn(false,processContent.wms_code,processContent.commodity_id)">
+                                        <span class="font-weight-bold">单据号:</span>
+                                        <span class="font-weight-bold">@{{ processContent.wms_code }}</span>
+                                        <span class="ml-2 text-muted">单据类型:</span>
+                                        <span class=" text-muted">@{{ processContent.bill_type }}</span>
+                                        <span class="ml-2 font-weight-bold">商品名:</span>
+                                        <span class="font-weight-bold">@{{ processContent.commodity_name }}</span>
+                                        <span class="ml-2 text-muted">SKU:</span>
+                                        <span class=" text-muted">@{{ processContent.commodity_sku }}</span>
+                                        <span class="ml-2 font-weight-bold">数量:</span>
+                                        <span class="font-weight-bold">@{{ processContent.amount }}</span>
+                                        <span class="ml-2 text-muted">条码:</span>
+                                        <span class="text-muted"><small v-if="processContent.commodity_barcodes && processContent.commodity_barcodes.length>0"
+                                                                        v-for="barcode in processContent.commodity_barcodes">@{{ barcode.code }}</small></span>
+                                        <button v-if="is_delBtn[processContent.wms_code+'_'+processContent.commodity_id]" @click="deleteProcessContent(processContent)" class="btn btn-sm btn-danger" style="position: absolute;right: 0;bottom: 0">删除</button>
+                                    </div>
+                                </div>
+                            </div>
                         </div>
-                        <div class="row pt-2">
-                            <label class="col-3 col-form-label text-right">条码</label>
-                            <ul class="p-0 m-0 ml-2 list-unstyled list-inline" v-if="processContent.commodity_barcodes && processContent.commodity_barcodes.length>0">
-                                <li v-for="barcode in processContent.commodity_barcodes"><small>@{{ barcode.code }}</small></li>
-                            </ul>
-                        </div>
-
-                        <div class="row pt-2">
-                            <label class="col-3 col-form-label text-right">SKU</label>
-                            <b  class="col-8">@{{ processContent.commodity_sku }}</b>
-                        </div>
-                        <div class="row pt-2">
-                            <label class="col-3 col-form-label text-right">单据类型</label>
-                            <select  v-model="processContent.bill_type" class="col-8 form-control"
-                                     :class="processContentError[processContent.wms_code] && processContentError[processContent.wms_code].bill_type ? 'is-invalid' :''">
-                                <option value="移库单">移库单</option>
-                                <option value="入库单">入库单</option>
-                                <option value="出库单">出库单</option>
-                            </select>
-                        </div>
-                        <div  class="row pt-2">
-                            <label class="col-3 col-form-label text-right">数量</label>
-                            <input v-model="processContent.amount" type="text" class="form-control col-8"
-                                   :class="processContentError[processContent.wms_code] && processContentError[processContent.wms_code].amount ? 'is-invalid' :''">
-                            <span v-if="processContentError[processContent.wms_code] && processContentError[processContent.wms_code].amount" class="invalid-feedback col-8 offset-3 mt-0" role="alert">
-                                <strong>@{{ processContentError[processContent.wms_code].amount[0] }}</strong>
-                            </span>
+                    </div>
+                    <div class="col-6 rounded mb-2 border" style="background: #ccd7dc;">
+                        <div class="form-group row mt-2">
+                            <label class="col-2 text-right mt-2">成品单据</label>
+                            <input class="form-control col-7" v-model="process.wms_code_full">&nbsp;&nbsp;&nbsp;
+                            <button class="btn btn-info btn-sm col-2"  type="button" @click="addProcessContent(true)"> 新增库单据</button>
                         </div>
-                        <div class="col-8 offset-2 pt-2" v-if="processContent.addBtnShow">
-                            <input type="button" @click="confirmStore(processContent.wms_code,processContent.commodity_id,processContent.amount)" value="确定新增" class="btn btn-primary form-control">
+                        <div class="form-group row">
+                            <div class="col-10 offset-1 pl-0 pt-2 border rounded bg-light">
+                                <div class="row pt-2 small"><label class="col-3 text-right" >单据号</label>
+                                    <b class="col-8" v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].is_full">@{{ processContents[0].wms_code }}</b></div> <!---->
+                                <div class="row pt-2" v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].is_full">
+                                    <span class="col-12 text-center text-muted small">双击选择商品:</span>
+                                    <span class=" col-11 offset-1 input-group" style=" border-radius: 5px; opacity: 1.5; text-align: center;">
+                                        <ul onselectstart="return false;" class="list-group tooltipTarget" style="width: 100%; max-height: 130px; overflow-y: scroll;">
+                                            <li  v-for="commodity in processContents[0].commodities" :id="commodity.id" :style="{'background-color':processContents[0].commodity_id==commodity.id ? '#9fcdff':''}"
+                                                 @dblclick="selectedCommodity(commodity,processContents[0].wms_code)" class="list-group-item list-group-item-action p-0 m-0">
+                                                <div class="form-inline" style="cursor: default; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
+                                                    <small :title="commodity.name" class="text-left text-info col-6" style="overflow: hidden;">@{{ commodity.name }}</small>
+                                                    <small class="text-left  col-6"><a v-for="barcode in commodity.barcodes">@{{ barcode.code }}&nbsp;&nbsp;&nbsp;</a></small>
+                                                </div>
+                                            </li>
+                                        </ul>
+                                    </span>
+                                </div>
+                                <div class="row pt-2 small"><label class="col-3  text-right">商品名</label>
+                                    <b v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].is_full" class="col-8">@{{ processContents[0].commodity_name }}</b>
+                                </div>
+                                <div class="row pt-2 small"><label class="col-3  text-right">条码</label>
+                                    <ul class="p-0 m-0 ml-2 list-unstyled list-inline" v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].is_full && processContents[0].commodity_barcodes && processContents[0].commodity_barcodes.length>0">
+                                        <li v-for="barcode in processContents[0].commodity_barcodes"><small>&nbsp;&nbsp;@{{ barcode.code }}</small></li>
+                                    </ul>
+                                </div>
+                                <div class="row pt-2 small"><label class="col-3  text-right">SKU</label>
+                                    <b v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].is_full" class="col-8">@{{ processContents[0].commodity_sku }}</b></div>
+                                <div class="row pt-2 small"><label class="col-3  text-right">单据类型</label>
+                                    <select v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].is_full"
+                                            v-model="processContents[0].bill_type"  class="col-8 form-control form-control-sm">
+                                        <option value="移库单">移库单</option>
+                                        <option value="入库单">入库单</option>
+                                        <option value="出库单">出库单</option>
+                                    </select></div>
+                                <div class="row pt-2 small"><label class="col-3  text-right">数量</label>
+                                    <input v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].is_full" v-model="processContents[0].amount" type="text" class="form-control form-control-sm col-8">
+                                </div>
+                                <div class="col-8 offset-2 pt-2 pb-2">
+                                    <input type="button" v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].is_full"
+                                           @click="confirmStore(processContents[0].wms_code,processContents[0].commodity_id,processContents[0].amount)"
+                                           value="确定新增" class="btn btn-primary btn-sm form-control form-control-sm">
+                                </div>
+                                <div class="col-8 offset-2 pt-2 pb-2">
+                                    <input v-if="processContents.length>0 && processContents[0].addBtnShow && processContents[0].is_full" type="button" @click="deleteProcessContent(processContents[0])" value="删除" class="btn btn-danger form-control">
+                                </div>
+                            </div>
                         </div>
-                        <div class="col-8 offset-2 pt-2 pb-2">
-                            <input type="button" @click="deleteProcessContent(processContent)" value="删除" class="btn btn-danger form-control">
+                        <div class="form-group row">
+                            <div class="col-10 offset-1 p-1 border rounded bg-light" v-for="processContent in processContents" v-if="!processContent.addBtnShow && processContent.is_full">
+                                <div class="col-12 border">
+                                    <div class="row small" style="position: relative" @mouseover="update_delBtn(true,processContent.wms_code,processContent.commodity_id)" @mouseleave="update_delBtn(false,processContent.wms_code,processContent.commodity_id)">
+                                        <span class="font-weight-bold">单据号:</span>
+                                        <span class="font-weight-bold">@{{ processContent.wms_code }}</span>
+                                        <span class="ml-2 text-muted">单据类型:</span>
+                                        <span class=" text-muted">@{{ processContent.bill_type }}</span>
+                                        <span class="ml-2 font-weight-bold">商品名:</span>
+                                        <span class="font-weight-bold">@{{ processContent.commodity_name }}</span>
+                                        <span class="ml-2 text-muted">SKU:</span>
+                                        <span class=" text-muted">@{{ processContent.commodity_sku }}</span>
+                                        <span class="ml-2 font-weight-bold">数量:</span>
+                                        <span class="font-weight-bold">@{{ processContent.amount }}</span>
+                                        <span class="ml-2 text-muted">条码:</span>
+                                        <span class="text-muted"><small v-if="processContent.commodity_barcodes && processContent.commodity_barcodes.length>0"
+                                                                        v-for="barcode in processContent.commodity_barcodes">@{{ barcode.code }}</small></span>
+                                        <button v-if="is_delBtn[processContent.wms_code+'_'+processContent.commodity_id]" @click="deleteProcessContent(processContent)" class="btn btn-sm btn-danger" style="position: absolute;right: 0;bottom: 0">删除</button>
+                                    </div>
+                                </div>
+                            </div>
                         </div>
                     </div>
                 </div>
+                <div class="form-group row">
+                    <label class="col-3 col-form-label text-right" >任务号</label>
+                    <input disabled :value="process.code" class="form-control col-8">
+                </div>
                 <div class="form-group row">
                     <label class="col-3 col-form-label text-right" >货主</label>
-                    <input readonly v-if="processContents.length>0" :value="processContents[processContents.length-1].owner_name?process.owner_name:processContents[processContents.length-1].owner_name" class="form-control col-8" :class="error.owner_id && error.owner_id.length>0 ? 'is-invalid' :''">
+                    <input readonly v-if="processContents.length>0" :value="process.owner_name" class="form-control col-8" :class="error.owner_id && error.owner_id.length>0 ? 'is-invalid' :''">
                     <span v-if="error.owner_id && error.owner_id.length>0" class="invalid-feedback col-8 offset-3 mt-0" role="alert">
                         <strong>@{{ error.owner_id[0] }}</strong>
                     </span>
@@ -129,13 +218,13 @@
             el:'#list',
             data:{
                 process:{id:'{{$process->id}}',code:'{{$process->code}}',wms_code:'',owner_id:'{{$process->owner_id}}',amount:'{{$process->amount}}',owner_name:'{{$process->owner_name}}',
-                    process_method_id:'{{$process->process_method_id}}',unit_price:'{{$process->unit_price}}',remark:'{{$process->remark}}'},
+                    process_method_id:'{{$process->process_method_id}}',unit_price:'{{$process->unit_price}}',remark:'{{$process->remark}}',wms_code_full:''},
                 error:{wms_code:[],owner_id:[],process_method_id:[],unit_price:[],amount:[]},
                 processContentError:[],
                 processContents:[
                     @foreach($process->processesContents as $processesContent)
                     {id:'{{$processesContent->id}}',wms_code:'{{$processesContent->wms_code}}',commodity_name:'{{$processesContent->commodity?$processesContent->commodity->name:""}}',@if($processesContent->commodity) commodity_barcodes:{!! $processesContent->commodity->barcodes !!},@endif
-                    commodity_id:'{{$processesContent->commodity_id}}',commodity_sku:'{{$processesContent->commodity?$processesContent->commodity->sku:""}}',bill_type:'{{$processesContent->bill_type}}',amount:'{{$processesContent->amount}}',addBtnShow:false},
+                    commodity_id:'{{$processesContent->commodity_id}}',commodity_sku:'{{$processesContent->commodity?$processesContent->commodity->sku:""}}',bill_type:'{{$processesContent->bill_type}}',amount:'{{$processesContent->amount}}',addBtnShow:false,is_full:'{{$processesContent->is_full=='Y'?true:false}}'},
                     @endforeach
                 ],
                 processMethods:[
@@ -146,6 +235,7 @@
                 tutorials:[],
                 selectedTutorials:[],
                 commodityIds:[],
+                is_delBtn:[],
             },
             mounted:function(){
                 let _this=this;
@@ -168,9 +258,10 @@
             },
             methods:{
                 //新增库单据
-                addProcessContent(){
+                addProcessContent(is_full){
                     let _this=this;
                     let wms_code=_this.process.wms_code;
+                    if (is_full) wms_code=_this.process.wms_code_full;
                     if (!wms_code){
                         tempTip.setDuration(3000);
                         tempTip.show('未输入单据号!');
@@ -214,6 +305,7 @@
                             processContent['bill_type']=response.data.bill_type;
                             processContent['amount']='';
                             processContent['addBtnShow']=true;
+                            processContent['is_full']=is_full;
                             _this.processContents.unshift(processContent);
                         }).catch(function (err) {
                             tempTip.setDuration(3000);
@@ -246,6 +338,7 @@
                 deleteProcessContent(processContent){
                     let _this=this;
                     let wms_code=processContent.wms_code;
+                    let commodity_id=processContent.commodity_id;
                     if (processContent.id){
                         if(!confirm("确定要删除该二次加工内容单“"+wms_code+"“吗?")){return}
                         axios.post('{{url("process/deleteProcessContent")}}/'+processContent.id)
@@ -262,7 +355,7 @@
                             });
                     }
                     _this.processContents.every(function (processContent,i) {
-                        if (processContent.wms_code==wms_code) {
+                        if (processContent.wms_code==wms_code && processContent.commodity_id==commodity_id) {
                             _this.processContents.splice(i,1);
                             _this.commodityIds.splice(_this.commodityIds.indexOf(processContent.commodity_id),1);
                             return false;
@@ -302,6 +395,7 @@
                     let unit_price=_this.process.unit_price;
                     let remark=_this.process.remark;
                     let amount=_this.process.amount;
+                    console.log(owner_id,process_method_id,unit_price,amount);
                     if (!owner_id || !process_method_id || !unit_price || !amount) {
                         tempTip.setDuration(3000);
                         tempTip.show('请确认您信息输入的完整性!');
@@ -329,13 +423,17 @@
                             tempTip.showSuccess('提交成功');
                             setTimeout(function () {
                                 location.href="{{url('process')}}";
-                            },1000)
+                            },100)
                         }
                     }).catch(function (err) {
                         tempTip.setDuration(3000);
                         tempTip.show('提交失败!网络错误:'+err);
                     });
                 },
+                update_delBtn(type,wms_code,commodity_id){
+                    if (type) this.$set(this.is_delBtn,wms_code+'_'+commodity_id,true);
+                    else this.$set(this.is_delBtn,wms_code+'_'+commodity_id,false);
+                }
             },
 
         });

+ 55 - 33
resources/views/process/index.blade.php

@@ -243,19 +243,19 @@
                     <th>提交日期</th>
                     <th>状态</th>
                     <th>备注</th>
-                    <th>单据类型</th>
-                    <th>单据号</th>
-                    <th>本单数量</th>
-                    <th>商品条码</th>
-                    <th>商品名称 </th>
+                    <th style="min-width: 200px">单据类型</th>
+                    <th style="min-width: 200px">单据号</th>
+                    <th style="min-width: 200px">本单数量</th>
+                    <th style="min-width: 200px">商品条码</th>
+                    <th style="min-width: 200px">商品名称 </th>
                 </tr>
                 <template>
-                <tr v-for="(processOne,i) in processes" :id="processOne.afterLocation?processOne.afterLocation:processOne.id">
-                    <td :rowspan="processOne.rowspan" v-if="processOne.id">
+                <tr v-for="(processOne,i) in processesContents" :id="processOne.afterLocation?processOne.afterLocation:processOne.id">
+                    <td v-if="processOne.id">
                         <input class="checkItem" type="checkbox" :value="processOne.id" v-model="checkData">
                     </td>
-                    <td :rowspan="processOne.rowspan" v-if="processOne.id" class="text-muted">@{{ i+1 }}</td>
-                    <td :rowspan="processOne.rowspan" v-if="processOne.id" style="min-width:150px" >
+                    <td v-if="processOne.id" class="text-muted">@{{ i+1 }}</td>
+                    <td v-if="processOne.id" style="min-width:150px" >
                         <p v-if="!processOne.openProcessHour && processOne.status=='驳回'" class="text-muted">已驳回</p>
                         <p v-if="!processOne.openProcessHour && processOne.status=='已完成'" class="text-success">已完成</p>
                         @can("二次加工管理-接单与驳回")
@@ -267,11 +267,11 @@
                         <button v-if="processOne.openProcessHour" @click="closeProcessHour(processOne.id);processOne.openProcessHour=false" class="btn btn-sm btn-dark pull-left">收起登记工时</button>@endcan
                         @can("二次加工管理-验收完成")<button v-if="!processOne.openProcessHour && processOne.status=='待验收'" @click="processAccomplish(processOne.id)" class="btn btn-sm btn-outline-success pull-left">完成</button>@endcan
                     </td>
-                    <td :rowspan="processOne.rowspan" v-if="processOne.id" class="text-muted">@{{ processOne.code }}</td>
-                    <td :rowspan="processOne.rowspan" v-if="processOne.id" class="text-muted">@{{ processOne.owner_name }}</td>
-                    <td :rowspan="processOne.rowspan" v-if="processOne.id">@{{ processOne.process_method_name }}</td>
-                    <td :rowspan="processOne.rowspan" v-if="processOne.id">@{{ processOne.amount }}</td>
-                    <td :rowspan="processOne.rowspan" v-if="processOne.id" >
+                    <td v-if="processOne.id" class="text-muted">@{{ processOne.code }}</td>
+                    <td v-if="processOne.id" class="text-muted">@{{ processOne.owner_name }}</td>
+                    <td v-if="processOne.id">@{{ processOne.process_method_name }}</td>
+                    <td v-if="processOne.id">@{{ processOne.amount }}</td>
+                    <td v-if="processOne.id" >
                         <div class="" v-if="processOne.tutorials" {{--style="width: 200px;overflow:auto;"--}}>
                             <div v-if=" processOne.tutorials.length>0">
                             <u v-if="!processOne.detailFolding" @click="showTutorial(processOne.tutorials[0].id)" class="text-info" style="cursor:pointer;">@{{processOne.tutorials[0].name}}</u>
@@ -298,22 +298,36 @@
                             </div>
                         </div>
                     </td>
-                    <td :rowspan="processOne.rowspan" v-if="processOne.id" class="text-muted">@{{ processOne.unit_price }}</td>
-                    <td :rowspan="processOne.rowspan" v-if="processOne.id">@{{ processOne.completed_amount }}</td>
-                    <td :rowspan="processOne.rowspan" v-if="processOne.id">@{{ processOne.created_at }}</td>
-                    <td :rowspan="processOne.rowspan" v-if="processOne.id" class="text-muted">@{{ processOne.status }}</td>
-                    <td :rowspan="processOne.rowspan" v-if="processOne.id" class="text-muted">@{{ processOne.remark }}</td>
-                    <td class="text-muted">@{{ processOne.bill_type }}</td>
-                    <td class="text-muted">@{{ processOne.wms_code }}</td>
-                    <td class="text-muted">@{{ processOne.thisAmount }}</td>
-                    <td class="text-muted">
-                        <ul class="p-0 m-0 list-unstyled list-inline" v-if="processOne.commodity_barcodes">
-                            <li v-for="barcode in processOne.commodity_barcodes"><small>@{{ barcode.code }}</small></li>
-                        </ul>
+                    <td v-if="processOne.id" class="text-muted">@{{ processOne.unit_price }}</td>
+                    <td v-if="processOne.id">@{{ processOne.completed_amount }}</td>
+                    <td v-if="processOne.id">@{{ processOne.created_at }}</td>
+                    <td v-if="processOne.id" class="text-muted">@{{ processOne.status }}</td>
+                    <td v-if="processOne.id" class="text-muted">@{{ processOne.remark }}</td>
+                    <td colspan="5">
+                        <table class="table table-sm table-striped" v-if="processUnfold[processOne.code] || processOne.processesContents.length==1">
+                            <tr v-for="processesContent in processOne.processesContents" v-if="processUnfold[processOne.code] ? processesContent.is_full==processUnfold[processOne.code] :processOne.processesContents.length==1">
+                                <td style="width: 180px" class="text-muted">@{{ processesContent.bill_type }}</td>
+                                <td style="width: 180px" class="text-muted">@{{ processesContent.wms_code }}</td>
+                                <td style="width: 180px" class="text-muted">@{{ processesContent.amount }}</td>
+                                <td style="width: 180px" class="text-muted">
+                                    <ul class="p-0 m-0 list-unstyled list-inline" v-if="processesContent.commodity">
+                                        <li v-for="barcode in processesContent.commodity.barcodes"><small>@{{ barcode.code }}</small></li>
+                                    </ul>
+                                </td>
+                                <td :title="processesContent.commodity_name" class="text-muted tooltipTarget"><div style="width: 180px;overflow:hidden" >@{{ processesContent.commodity_name }}</div></td>
+                            </tr>
+                            <tr v-if="processUnfold[processOne.code]">
+                               <td colspan="5">
+                                   <div class="text-center">
+                                       <b v-if="processUnfold[processOne.code]=='N'" style="cursor:pointer;color: #4aa0e6;text-decoration:underline" @click="processUnfold=[]">点击关闭原料单</b><br>
+                                       <b v-if="processUnfold[processOne.code]=='Y'" style="cursor:pointer;color: #4aa0e6;text-decoration:underline" @click="processUnfold=[]">点击关闭成品单</b></div>
+                               </td>
+                            </tr>
+                        </table>
+                        <div v-if="!processUnfold[processOne.code] && processOne.processesContents.length>1" class="text-center">
+                        <b v-if="processFullSum[processOne.code]!=processOne.processesContents.length" style="cursor:pointer;color: #4aa0e6;text-decoration:underline" @click="unfold(processOne.code,'N')">点击展开原料单</b><br>
+                        <b v-if="processFullSum[processOne.code] && processFullSum[processOne.code]!=0" style="cursor:pointer;color: #4aa0e6;text-decoration:underline" @click="unfold(processOne.code,'Y')">点击展开成品单</b></div>
                     </td>
-                    <td class="text-muted">@{{ processOne.commodity_name }}</td>
-
-
                 </tr>
                 <tr id="addProcessDailyParticipants" v-show="processDailyParticipants.length>0">
                     <td colspan="2"></td>
@@ -432,7 +446,7 @@
                 processesContents:[
                     @foreach($processes as $processOne)
                     {id:'{{$processOne->id}}',code:'{{$processOne->code}}',owner_name:'{{$processOne->owner_name}}',owner_id:'{{$processOne->owner_id}}',
-                        process_method_name:'{{$processOne->process_method_name}}',amount:'{{$processOne->amount}}'
+                        process_method_name:'{{$processOne->process_method_name}}',amount:'{{$processOne->amount}}',is_full:'{{$processOne->is_full}}'
                         ,tutorials:{!! $processOne->tutorials !!},processesContents:{!! $processOne->processesContents !!},unit_price:'{{$processOne->unit_price}}',created_at:'{{$processOne->created_at}}',
                         completed_amount:'{{$processOne->completed_amount}}',status:'{{$processOne->status}}',remark:'{{$processOne->remark}}',detailFolding:false,openProcessHour:false,},
                     @endforeach
@@ -457,6 +471,8 @@
                 processDailyParticipantOne:{id:'',user_id:'',user_detail_full_name:'',started_at:"",ended_at:"",
                                         hour_price:'',unit_price:'',dinner_duration:'',hour_count:'',unit_count:'',remark:''},
                 processTutorial:{id:'',owner_id:'',tutorials:[],},
+                processUnfold:[],
+                processFullSum:[],
             },
             watch:{
                 checkData:{
@@ -513,6 +529,7 @@
                             continue;
                         }
                         process.processesContents.every(function (processesContent,count) {
+                            if (processesContent.is_full==='Y')_this.$set(_this.processFullSum,process.code,_this.processFullSum[process.code]?_this.processFullSum[process.code]+1:1);
                             let processOne={};
                             if ((count+1)==process.processesContents.length){
                                 processOne['afterLocation'] = process.id+"-"+process.processesContents.length;
@@ -1217,9 +1234,14 @@
                     location.href = "{{url('process')}}/"+id+"/edit";
                 },
                 //去往新增教程
-                addTutorial(){
-                    window.open("{{url('maintenance/tutorial/create?owner_id=')}}"+this.processTutorial.owner_id);
-                }
+                addTutorial() {
+                    window.open("{{url('maintenance/tutorial/create?owner_id=')}}" + this.processTutorial.owner_id);
+                },
+                //展开内容单
+                unfold(code,is_full){
+                    this.processUnfold=[];
+                    this.$set(this.processUnfold,code,is_full);
+                },
             },
         });
     </script>

+ 154 - 47
resources/views/waybill/index.blade.php

@@ -169,7 +169,9 @@
                     <th class="td-transit">承运商计重</th>
                     <th class="td-transit">计数</th>
                     <th class="td-transit">里程</th>
+                    @can('运输管理-运费')
                     <th class="td-fee">运费</th>
+                    @endcan
                     <th class="td-fee">提货费</th>
                     <th class="td-fee">其他费用</th>
                     <th class="td-fee">调度备注</th>
@@ -220,26 +222,29 @@
                         </span>
                     </td>
                     @can('运输管理-置顶')
-                    <td class=" text-muted toptd" >
-                        <div v-if="waybill.remark" class="bg-dark  text-warning top"  data-toggle="tooltip" style="opacity: 0.1"
-                        >@{{  waybill.remark }}</div>
-                        <a v-if="waybill.remark" class="text-muted" @click="cancelOnTop($event)" :data_id="waybill.id" href="javascript:0">取消<br>置顶</a>
-                        <a v-else @click="waybillOnTop($event)" :data_id="waybill.id" class="text-danger" href="javascript:0">置顶</a>
+                    <td class="td-bill text-muted" v-if="waybill.remark" style="height: 55px">
+                        <button type="button" class="btn btn-sm btn-outline-danger " @click="cancelOnTop($event)" :data_id="waybill.id"  style="opacity: 0.75">取消</button>
+                    </td>
+                    <td v-else>
+                        <button type="button" class="btn btn-sm btn-outline-secondary" @click="waybillOnTop($event)" :data_id="waybill.id"  style="opacity: 0.75">置顶</button>
                     </td>
                     @endcan
                     <td :class="[waybill.status=='已审核'?'text-success':'']">@{{waybill.status}}</td>
-                    <td class="td-bill text-muted">@{{waybill.id}}</td>
+                    <td class="td-bill text-muted toptd" >
+                        <div v-if="waybill.remark" class="bg-light-yellow  text-danger top"  data-toggle="tooltip" style="opacity: 0.1;position: absolute"
+                        >置顶备注:@{{  waybill.remark }}</div>
+                        @{{waybill.id}}</td>
                     <td class="td-bill text-muted">@{{waybill.created_at}}</td>
                     <td class="td-bill">@{{waybill.type}} <span class="badge badge-sm bg-warning" v-if="waybill.collect_fee">到付</span></td>
                     <td class="td-bill">@{{waybill.owner}}</td>
-                    <td class="td-bill toptd" :title="waybill.remark">@{{waybill.source_bill}}</td>
+                    <td class="td-bill toptd" :title="'置顶备注:'+waybill.remark">@{{waybill.source_bill}}</td>
                     <td class="td-bill" >@{{waybill.wms_bill_number}}</td>
                     <td class="td-bill">@{{waybill.waybill_number}}</td>
                     <td class="td-bill">
                         <div align="center" @mouseleave="removeCommonImg('common_img_'+waybill.id)" @mouseenter="commonImg('img_'+waybill.id,waybill.url,waybill.suffix)">
                             <img v-if="waybill.url" :id="'img_'+waybill.id"  :data-src="waybill.url+'-thumbnail.'+waybill.suffix" src="{{url('icon/img404-thumbnail.jpg')}}">
                             @can('运输管理-图片上传')<div v-if="!waybill.url">
-                                <input class="btn  btn-sm btn-outline-secondary" type="button" @click="certiimg(waybill.waybill_number)" value="上传图片"/>
+                                <input class="btn  btn-sm btn-outline-secondary" type="button" @click="certiimg(waybill.waybill_number)" value="上传照片 "/>
                                 <input type="file" @change="submitFile($event,waybill.waybill_number)" :id="waybill.waybill_number"
                                        style="display: none" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg"/>
                             </div>@endcan
@@ -250,21 +255,34 @@
                     <td class="td-transit text-muted">@{{waybill.origination}}</td>
                     <td class="td-transit text-muted">@{{waybill.destination}}</td>
                     <td class="td-transit">@{{waybill.carrier}}</td>
-                    <td class="td-transit"><span v-if="waybill.type=='专线'">@{{waybill.carrier_bill}}</span>
-                        <span v-if="waybill.type=='直发车'">
+                    <td class="td-transit"><span v-if="waybill.type==='专线'">@{{waybill.carrier_bill}}</span>
+                        <span v-if="waybill.type==='直发车'">
                             <span v-if="waybill.carType">@{{ waybill.carType.name }}<i v-if="waybill.carType.length">(@{{waybill.carType.length}}米)</i></span></span></td>
-                    <td class="td-transit"><span v-if="waybill.warehouse_weight">@{{waybill.warehouse_weight}}  @{{waybill.warehouse_weight_unit}}</span></td>
-                    <td class="td-transit"><span v-if="waybill.carrier_weight">@{{waybill.carrier_weight}}  @{{waybill.carrier_weight_unit}}</span></td>
-                    <td class="td-transit"><span v-if="waybill.warehouse_weight_other">@{{waybill.warehouse_weight_other}}  @{{waybill.warehouse_weight_unit_other}}</span></td>
-                    <td class="td-transit"><span v-if="waybill.carrier_weight_other">@{{waybill.carrier_weight_other}}  @{{waybill.carrier_weight_unit_other}}</span></td>
-                    <td class="td-transit"><span v-if="waybill.amount">@{{waybill.amount}} @{{waybill.amount_unit_name }}</span></td>
+                    <td class="td-transit"><span v-if="waybill.warehouse_weight">@{{waybill.warehouse_weight|filterZero}}  @{{waybill.warehouse_weight_unit}}</span></td>
+                    <td class="td-transit"><span v-if="waybill.carrier_weight">@{{waybill.carrier_weight|filterZero}}  @{{waybill.carrier_weight_unit}}</span></td>
+                    <td class="td-transit"><span v-if="waybill.warehouse_weight_other">@{{waybill.warehouse_weight_other|filterZero}}  @{{waybill.warehouse_weight_unit_other}}</span></td>
+                    <td class="td-transit"><span v-if="waybill.carrier_weight_other">@{{waybill.carrier_weight_other|filterZero}}  @{{waybill.carrier_weight_unit_other}}</span></td>
+                    <td class="td-transit">@{{waybill.amount}}</td>
                     <td class="td-transit">@{{waybill.mileage|km}} </td>
                     @can('运输管理-可见费用项')
                         {{--zengjun start--}}
                         @can('运输管理-运费')
-                            <td class="td-fee">
-                                <span v-if="waybill.type=='专线'"></span><span v-else-if="waybill.fee" class="btn-sm btn-outline-secondary btn" @click="waybillFeeCheck($event)" :data_id="waybill.id">@{{waybill.fee}}</span>
-                                <input type="number" class="form-control form-control-sm"  @blur="udpateWaybillFee($event)" :value="waybill.fee" :data_id="waybill.id" style="min-width:85px;display: none">
+{{--                            <td class="td-fee" v-if="waybill.type==='专线'">--}}
+
+{{--                            </td>--}}
+{{--                            <td class="td-fee" v-else-if="waybill.type==='直发车'">--}}
+{{--                                <span v-if="waybill.fee" class="btn-sm btn-outline-secondary btn" @click="waybillFeeCheck($event)" :data_id="waybill.id">@{{waybill.fee}}</span>--}}
+{{--                                <input type="number" class="form-control form-control-sm"  @blur="updateWaybillFee($event)" v-model="waybill.fee" :data_id="waybill.id" style="min-width:85px;display: none">--}}
+{{--                                <input v-else type="number" class="form-control form-control-sm">--}}
+{{--                            </td>--}}
+                            <td class="td-fee" v-if="waybill.fee">
+                                <span v-if="waybill.type==='专线'"></span>
+                                <span v-else-if="waybill.fee" class="btn-sm btn-outline-secondary btn" @click="waybillFeeCheck($event)" :data_id="waybill.id">@{{waybill.fee|money}}</span>
+                                <input type="number" class="form-control form-control-sm"  @blur="updateWaybillFee($event)" :value="waybill.fee" :data_id="waybill.id" style="min-width:85px;display: none">
+                            </td>
+                            <td v-else>
+                                <span v-if="waybill.type==='专线'"></span>
+                                <input v-else type="number" class="form-control form-control-sm" @blur="addWaybillFee($event)" onfocus="$(this).css('width','85px')" :value="waybill.fee" :data_id="waybill.id" >
                             </td>
                         @endcan
                         {{--zengjun end--}}
@@ -273,7 +291,9 @@
                     @endcan
                     <td class="td-fee">@{{waybill.dispatch_remark}}</td>
                     @can('运输管理-删除')
-                        <td class="td-operation btn-outline-danger" @click="waybillDestroy(waybill.id,waybill.waybill_number)">删除</td>
+                        <td class="td-operation">
+                            <button type="button" class="btn btn-outline-danger btn-sm" @click="waybillDestroy(waybill.id,waybill.waybill_number)">删</button>
+                        </td>
                     @endcan
                     {{--                    <td>@{{waybill.wms_bill_number}}</td>--}}
                     {{--                    <td>@{{waybill.recipient}}</td>--}}
@@ -342,10 +362,37 @@
                 {{--                    </td>--}}
                 {{--                </tr>--}}
             </table>
+            <div class="modal fade " id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
+                <div class="modal-dialog modal-dialog-centered">
+                    <div class="modal-content">
+                        <div class="modal-header">
+                            <h5 class="modal-title" id="exampleModalLabel">请输入置顶备注</h5>
+                            <button type="button" class="close"  data-dismiss="modal" aria-label="Close" @click="changeRemark">
+                                <span aria-hidden="true">&times;</span>
+                            </button>
+                        </div>
+                        <div class="modal-body">
+                            <input type="hidden" class="form-control" id="onTopId">
+                            <textarea type="text" class="form-control"  required id="remark" @change="changeRemark"  ></textarea>
+                            <div class="invalid-feedback">
+                                备注信息不能为空
+                            </div>
+                        </div>
+                        <div class="modal-footer">
+                            <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal" @click="changeRemark" >关闭</button>
+                            <button type="button" class="btn btn-sm btn-primary" @click="submitOnTop">提交</button>
+                        </div>
+                    </div>
+                </div>
+            </div>
             <div class="text-info h5 btn btn">{{$waybills->count()}}/{{$waybills->total()}}</div>
             {{$waybills->appends($filterData)->links()}}
         </div>
     </div>
+
+
+
+
 @endsection
 
 
@@ -353,10 +400,12 @@
     <style type="text/css">
         @keyframes anima
         {
-            0%{opacity:0.1}
-            60%{opacity:0.4}
-            80%{opacity:0.6}
-            100%{opacity:0.75}
+            from {
+                opacity:0.1;
+            }
+            to{
+                opacity:1;
+            }
         }
         @-webkit-keyframes anima
         {
@@ -367,25 +416,27 @@
                 opacity:0.1;
             }
         }
+        .bg-light-yellow{
+            background: #fffff8;
+        }
         .top{
             padding-top: 0px;
             padding-left: 10px;
-            margin-left: 88px;
             margin-top: -4px;
+            margin-left: -5px;
             line-height: 55px;
 
+
             position: absolute;
             animation: anima;
-            animation-duration: 2s;
-            animation-timing-function: linear;
-            animation-delay: 0.5s;
+            animation-duration: 3s;
+            animation-timing-function: cubic-bezier(0,0,1,1);
             animation-direction: alternate;
             animation-play-state: running;
 
             -webkit-animation-name: anima;
-            -webkit-animation-duration: 2s;
-            -webkit-animation-timing-function: linear;
-            -webkit-animation-delay: 0.5s;
+            -webkit-animation-duration: 3s;
+            -webkit-animation-timing-function:  cubic-bezier(0,0,1,1);
             -webkit-animation-iteration-count: infinite;
             -webkit-animation-direction: alternate;
             -webkit-animation-play-state: running;
@@ -410,7 +461,6 @@
                         warehouse_weight_other:'{{$waybill->warehouse_weight_other}}',
                         warehouse_weight_unit_other:'{{$waybill->warehouse_weight_unit_other_name}}',carrier_weight_other:'{{$waybill->carrier_weight_other}}',
                         carrier_weight_unit_other:'{{$waybill->carrier_weight_unit_other_name}}',
-                        amount_unit_name:'{{$waybill->amount_unit_name}}',
                         mileage:'{{$waybill->mileage}}',amount:'{{$waybill->amount}}',
                         @if($waybill->carType)carType:{!! $waybill->carType !!},car_owner_info:'{{$waybill->car_owner_info}}',@endif @can('运输管理-可见费用项') fee:'{{$waybill->fee}}',
                         pick_up_fee:'{{$waybill->pick_up_fee}}',other_fee:'{{$waybill->other_fee}}',
@@ -469,7 +519,7 @@
                 this.initInputs();
                 $(".tooltipTarget").tooltip({'trigger':'hover'});
                 $('#list').removeClass('d-none');
-                 let waybill =  $('.table-header-layer-1')[1];
+                let waybill =  $('.table-header-layer-1')[1];
                 $('.top').css('min-width', waybill.scrollWidth);
 
                 this.imgs=Array.from(document.getElementById('list').querySelectorAll('img'));
@@ -847,31 +897,71 @@
                     input.focus();
                 },
                 // 失焦事件
-                udpateWaybillFee:function (e) {
-                    let _this = this;
+                updateWaybillFee:function (e) {
                     let target = $(e.target);
+                    let _this = this;
                     let span = target.prev();
                     let id = target.attr('data_id');
+                    let oldFee = span.text();
                     let fee = target.val();
                     if(fee !== span.text()){
                         let ajaxUrl= '{{url("apiLocal/waybill/changeFee")}}';
                         axios.post(ajaxUrl,{'id':id,'fee':fee}).then(function (response) {
                             if(response.data.success){
+                                _this.updateWaybills(id,fee);
                                 tempTip.setDuration(2000);
                                 tempTip.showSuccess('运单运费修改成功');
-                                span.text(fee);
                             }else{
                                 tempTip.setDuration(3000);
                                 tempTip.show('运单运费修改失败!'+response.data.fail_info);
+                                _this.updateWaybills(id,oldFee);
                             }
                         }).catch(function (err) {
                             tempTip.setDuration(3000);
-                            tempTip.show('运单运费修改失败!'+response.data.fail_info);
+                            tempTip.show('运单运费修改失败!网络异常:'+err);
+                            _this.updateWaybills(id,oldFee);
                         });
                     }
                     span.show();
                     target.hide();
                 },
+                // 为直发车运单添加运费
+                addWaybillFee(e){
+                    let target = $(e.target);
+                    target.css('width','85px');
+                    let _this = this;
+                    let id = target.attr('data_id');
+                    let fee = target.val();
+                    let ajaxUrl= '{{url("apiLocal/waybill/changeFee")}}';
+                    if(fee === ''|| fee === null){
+                        target.css('width','75px');
+                        return;
+                    }else{
+                        axios.post(ajaxUrl,{'id':id,'fee':fee}).then(function (response) {
+                            if(response.data.success){
+                                tempTip.setDuration(2000);
+                                tempTip.showSuccess('运单运费添加成功');
+                                _this.updateWaybills(id,fee);
+                            }else{
+                                tempTip.setDuration(3000);
+                                tempTip.show('运单运费添加失败!'+response.data.fail_info);
+                            }
+                        }).catch(function (err) {
+                            tempTip.setDuration(3000);
+                            tempTip.show('运单运费添加失败!网络异常:'+response.data.fail_info);
+                        });
+                        target.css('width','75px');
+                    }
+                },
+                // 更新表格数据
+                updateWaybills(id,newFee){
+                    this.waybills.some(function(waybill){
+                        if(waybill.id === id){
+                            waybill.fee = newFee;
+                            return true;
+                        }
+                    })
+                },
                 // 置顶操作
                 waybillOnTop:function(e){
                     let target = $(e.target);
@@ -887,18 +977,20 @@
                                     tempTip.showSuccess('置顶成功');
                                     setTimeout(function(){
                                         window.location.reload();
-                                        }
+                                    }
                                     ,1000);
-                                }else{
-                                    tempTip.setDuration(3000);
-                                    tempTip.show('置顶失败!'+response.fail_info);
-                                }
-                            }).catch(function (err) {
-                                tempTip.setDuration(30000);
-                                tempTip.show('置顶失败,网络连接错误!'+err);
-                            });
-                        }
-                    });
+                            }else{
+                                tempTip.setDuration(3000);
+                                tempTip.show('置顶失败!'+response.fail_info);
+                            }
+                        }).catch(function (err) {
+                            tempTip.setDuration(3000);
+                            tempTip.show('置顶失败,网络连接错误!'+err);
+                        });
+                    }
+                },
+                changeRemark:function(){
+                  $('#remark').removeClass('is-invalid');
                 },
                 cancelOnTop:function (e) {
                     let target = $(e.target);
@@ -943,7 +1035,22 @@
                     if(!value)return '';
                     return value + ' km';
                 },
+                money:function(value){
+                    if(value.indexOf('.')>0){
+                        return value
+                    }
+                    return value += '.00';
+                },
+                filterZero:function(value){
+                    value=value.replace(/\.00$/,'');
+                    value=value.replace(/(\.[1-9])0$/,'$1');
+                    return value;
+                },
             }
         });
+        // modal 隐藏时修改 input 为空
+        $("#exampleModal").on('hide.bs.modal',function(e){
+            $('#remark').val('');
+        });
     </script>
 @endsection

Some files were not shown because too many files changed in this diff