Zhouzhendong 5 anos atrás
pai
commit
2c0aa0ae5f

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

@@ -414,16 +414,16 @@ class ProcessController extends Controller
     public function updateProcessDailyParticipant(Request $request){
         if(!Gate::allows('二次加工管理-登记工时')){ return redirect(url('/'));  }
         $id=$request->input('id');
-        if (!$id) return ['status'=>"error",'data'=>"修改失败,ID未传递"];
+        if (!$id) return ['success'=>false,'data'=>"修改失败,ID未传递"];
         $errors=$this->validatorProcessDailyParticipant($request)->errors();
-        if (count($errors)>0)return ['status'=>"error",'data'=>$errors];
+        if (count($errors)>0)return ['success'=>false,'data'=>$errors];
         $processDailyParticipant=ProcessDailyParticipant::with(['processDaily'=>function($query){
             $query->with('process');
         },'userLabor'])->find($id);
         if (!$processDailyParticipant || !$processDailyParticipant->processDaily
-            || !$processDailyParticipant->processDaily->process || !$processDailyParticipant->userLabor) return ['status'=>"error",'data'=>"修改失败,该信息不存在"];
+            || !$processDailyParticipant->processDaily->process || !$processDailyParticipant->userLabor) return ['success'=>false,'data'=>"修改失败,该信息不存在"];
         if ($processDailyParticipant->userLabor->isOccupiedAt($processDailyParticipant->processDaily->date,$request->started_at)){
-            ['status'=>"error",'data'=>"该临时工此时间段已存在工作记录"];
+            ['success'=>false,'data'=>"该临时工此时间段已存在工作记录"];
         }
         $processDailyParticipant->user_id=$request->input('user_id');
         $processDailyParticipant->started_at=$request->input('started_at');
@@ -440,7 +440,7 @@ class ProcessController extends Controller
             $this->statistic($processDailyParticipant->processDaily->process);
         }
         //$processDailyParticipant=$this->countParticipantManHour($processDailyParticipant,$processDailyParticipant->processDaily->date);
-        return ['status'=>"success",'data'=>$processDailyParticipant];
+        return ['success'=>true,'data'=>$processDailyParticipant];
     }
     /*//参与人审核
     public function processDailyParticipantAudit($id){

+ 3 - 1
resources/views/process/create.blade.php

@@ -574,11 +574,13 @@
                     axios.post('{{url('process/importPasteData')}}',{data:this.pasteData,rows:this.rows})
                         .then(res=>{
                             if (res.data.success){
+                                let sum=0;
                                 res.data.data.forEach(function (processContent) {
                                     _this.processContents.unshift(processContent);
                                     _this.commodityIds.push(processContent.commodity_id+"_"+processContent.type);
-                                    _this.sum += Number(processContent.amount);
+                                    if (!processContent.type) sum += Number(processContent.amount);
                                 });
+                                _this.sum += sum;
                                 $('#pasteData').modal('hide');
                                 tempTip.setDuration(2000);
                                 tempTip.showSuccess('导入完毕');

+ 34 - 30
resources/views/process/index.blade.php

@@ -181,7 +181,7 @@
                     <th style="min-width: 200px">单据号</th>
                     <th style="min-width: 100px">本单数量</th>
                     <th style="min-width: 200px">商品条码</th>
-                    <th style="min-width: 200px">商品名称 </th>
+                    <th style="min-width: 300px">商品名称 </th>
                     <th>备注</th>
                     <th></th>
                 </tr>
@@ -321,7 +321,7 @@
                         ,{'-webkit-transform':'scale('+(1/Math.ceil(arrayFilter(processOne.processesContents,processOne).length/3))+')'},{height: (35*Math.ceil(arrayFilter(processOne.processesContents,processOne).length/3))+'px'}
                         ,{width: (100*Math.ceil(arrayFilter(processOne.processesContents,processOne).length/3))+'%'},{'margin-left': (-100*((Math.ceil(arrayFilter(processOne.processesContents,processOne).length/3))-1)/2)+'%'}
                         ,{'margin-top': (-35*((Math.ceil(arrayFilter(processOne.processesContents,processOne).length/3))-1)/2)+'px'},{'margin-bottom': (-35*((Math.ceil(arrayFilter(processOne.processesContents,processOne).length/3))-1)/2)+'px'}]">
-                            <div v-for="(processesContent,i) in arrayFilter(processOne.processesContents,processOne)"  class=" row  p-1" style="float: left;margin-right: 20px;-webkit-transform-origin: 0" :style="[{opacity:1/0.7},
+                            <div v-for="(processesContent,i) in arrayFilter(processOne.processesContents,processOne)"  class=" row  p-1" style="float: left;margin-right: 10px;-webkit-transform-origin: 0" :style="[{opacity:1/0.7},
                             {'margin-left': arrayFilter(processOne.processesContents,processOne).length >3 ? (1*parseInt(arrayFilter(processOne.processesContents,processOne).length/3))+'px' : '0px'}]">
                                 <span>@{{ processesContent.bill_type }}</span>&nbsp;&nbsp;
                                 <span>@{{ processesContent.wms_code }}</span>&nbsp;&nbsp;
@@ -1145,35 +1145,39 @@
                     let _this = this;
                     axios.post("{{url('process/updateProcessDailyParticipant')}}", this.processDailyParticipantOne)
                         .then(function (response) {
-                            if (response.data.status == "error") {
-                                tempTip.setDuration(3000);
-                                _this.errors = response.data.data;
-                            }
-                            if (response.data.status == "success") {
-                                _this.processDailyParticipants.every(function (processDailyParticipant) {
-                                    if (processDailyParticipant.id == response.data.data.id) {
-                                        processDailyParticipant.status = response.data.data.status;
-                                        processDailyParticipant.user_detail_full_name = response.data.data.user_detail_full_name;
-                                        processDailyParticipant.started_at = response.data.data.started_at;
-                                        processDailyParticipant.ended_at = response.data.data.ended_at;
-                                        processDailyParticipant.hour_price = response.data.data.hour_price;
-                                        processDailyParticipant.unit_price = response.data.data.unit_price;
-                                        processDailyParticipant.dinner_duration = response.data.data.dinner_duration;
-                                        processDailyParticipant.hour_count = response.data.data.hour_count;
-                                        processDailyParticipant.unit_count = response.data.data.unit_count;
-                                        processDailyParticipant.remark = response.data.data.remark;
-                                        processDailyParticipant.hour = response.data.data.hour;
-                                        processDailyParticipant.diff = response.data.data.diff;
-                                        processDailyParticipant.billingHour = response.data.data.billingHour;
-                                        processDailyParticipant.isAddProcessDailyParticipant = true;
-                                        return false;
-                                    }
-                                    return true;
-                                });
-                                tempTip.setDuration(3000);
-                                tempTip.showSuccess('参与人修改成功!');
-                                $("#updateModal").modal('hide');
+                            if (!response.data.success) {
+                                if (response.data.data.length>0){
+                                    _this.errors = response.data.data;
+                                }
+                                else {
+                                    tempTip.setDuration(3000);
+                                    tempTip.show(response.data.data);
+                                }
+                                return;
                             }
+                            _this.processDailyParticipants.every(function (processDailyParticipant) {
+                                if (processDailyParticipant.id == response.data.data.id) {
+                                    processDailyParticipant.status = response.data.data.status;
+                                    processDailyParticipant.user_detail_full_name = response.data.data.user_detail_full_name;
+                                    processDailyParticipant.started_at = response.data.data.started_at;
+                                    processDailyParticipant.ended_at = response.data.data.ended_at;
+                                    processDailyParticipant.hour_price = response.data.data.hour_price;
+                                    processDailyParticipant.unit_price = response.data.data.unit_price;
+                                    processDailyParticipant.dinner_duration = response.data.data.dinner_duration;
+                                    processDailyParticipant.hour_count = response.data.data.hour_count;
+                                    processDailyParticipant.unit_count = response.data.data.unit_count;
+                                    processDailyParticipant.remark = response.data.data.remark;
+                                    processDailyParticipant.hour = response.data.data.hour;
+                                    processDailyParticipant.diff = response.data.data.diff;
+                                    processDailyParticipant.billingHour = response.data.data.billingHour;
+                                    processDailyParticipant.isAddProcessDailyParticipant = true;
+                                    return false;
+                                }
+                                return true;
+                            });
+                            tempTip.setDuration(3000);
+                            tempTip.showSuccess('参与人修改成功!');
+                            $("#updateModal").modal('hide');
                         }).catch(function (err) {
                         tempTip.setDuration(5000);
                         tempTip.show('修改参与人发生了一些严重错误:' + err);

+ 1 - 1
resources/views/rejected/search/general.blade.php

@@ -233,7 +233,7 @@
                     @endforeach
                 ],
             },
-            mounted:function(){
+            mounted:function(){console.log(decodeURIComponent('eJxtkltLw0AQhf%2FLQt%2BWZO%2B7CRSJVqSCt7YWVPqQtiGW2gttlErxv3smbTGokIdvZ86eObNkzzbdKUulEF4Izj6KDUuZjETkGGfVFh2bOBGkF1IGCCY%2FNeutUUnC2Xgz7LD0RSoIrA8jqvRQOFS8EiN%2BQBeAyuAjTRcS9lpV620ax%2Bu8LKJ1MduulmW0KGbVe76MJqtFvH7LP8f5ZP7cj2fLabE7q%2FJxW7cuVSuIVnKBlAxmiwGZOc%2BlESj9Dzo5QSBwTfAnoL2daYIhUAB1AkkgAORsEy4VOdvQgEPLH29ZctYEJ0OrjyOsOCY0uGVIYygztQxuGTI0EFvyMRBbiqohdlTR0DgSazh78tFI6A09yrx%2BlD0%2Fv%2Bs8ofEboMgbz8YztGCBCbpmJ%2BGE5P377PbvkZa0qhYqidkqHJhWFYF3usM6XeAuqQ%2BYVtE0mnqDfwzd7axcgorr3eCx7GbZVZn1Htpt9vUNb5aS1Q%3D%3D'))
                 $(".tooltipTarget").tooltip({'trigger':'hover'});
                 $('#list').removeClass('d-none');
                 let data=[

+ 0 - 1
tests/webApi/test.http

@@ -37,4 +37,3 @@ Content-Type: application/json
 GET https://was.baoshi56.com/api/thirdPart/weixin/waybill?api_token=fb7efc3
 
 ###
-