Zhouzhendong 5 лет назад
Родитель
Сommit
672a693951

+ 10 - 7
app/Http/Controllers/ProcessController.php

@@ -244,13 +244,16 @@ class ProcessController extends Controller
         $process=Process::select('id','status','amount')->find($id);
         $amount=$process->amount;
         $today=Carbon::now()->format('Y-m-d');
-        $processDaily=new ProcessDaily([
-            'process_id'=>$id,
-            'date'=>$today,
-            'output'=>0,
-            'remain'=>$amount,
-        ]);
-        $processDaily->save();
+        $processDaily=ProcessDaily::where('date',$today)->where('process_id',$id)->first();
+        if (!$processDaily){
+            $processDaily=new ProcessDaily([
+                'process_id'=>$id,
+                'date'=>$today,
+                'output'=>0,
+                'remain'=>$amount,
+            ]);
+            $processDaily->save();
+        }
         $process->status="待加工";
         $process->update();
         $this->log(__METHOD__,"接单二次加工单_".__FUNCTION__,json_encode($process),Auth::user()['id']);

+ 4 - 4
resources/views/process/edit.blade.php

@@ -12,8 +12,8 @@
         <div class="card col-md-8 offset-md-2">
             <div class="card-body">
                 <div class="row">
-                    <div class="col-6  rounded mb-2 border" style="background: #efe3d9;" v-if="!is_hide">
-                        <div class="form-group row mt-2">
+                    <div class="col-6  rounded mb-2 border" style="background: #efe3d9;">
+                        <div class="form-group row mt-2" v-if="!is_hide">
                             <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>
@@ -66,7 +66,7 @@
                                 </div>
                             </div>
                         </div>
-                        <div class="form-group row">
+                        <div class="form-group row" :class="is_hide ? 'mt-3' : ''">
                             <div class="col-10 offset-1 p-1 border rounded bg-light" v-for="processContent in processContents" v-if="!processContent.addBtnShow && !processContent.type">
                                 <div class="col-12 border">
                                     <div class="row small"  @mouseover="update_delBtn(true,processContent.wms_code,processContent.commodity_id,false)" @mouseleave="update_delBtn(false,processContent.wms_code,processContent.commodity_id,false)">
@@ -89,7 +89,7 @@
                             </div>
                         </div>
                     </div>
-                    <div class="col-6 rounded mb-2 border" style="background: #ccd7dc;" :class="is_hide ? 'm-auto':''">
+                    <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;

+ 3 - 3
resources/views/process/index.blade.php

@@ -249,7 +249,7 @@
                     <th style="min-width: 200px">商品名称 </th>
                 </tr>
                 <template>
-                <tr v-for="(processOne,i) in processes" :id="processOne.afterLocation?processOne.afterLocation:processOne.id">
+                <tr v-for="(processOne,i) in processes" :id="processOne.id?processOne.id:processes[i-1].id+'-2'">
                     <td v-if="processOne.id" :rowspan="processOne.is_multi_row?2:''">
                         <input class="checkItem" type="checkbox" :value="processOne.id" v-model="checkData">
                     </td>
@@ -368,7 +368,7 @@
                                 </td>
                                 <td v-if="processDailyParticipant.rowspan" :rowspan="processDailyParticipant.rowspan"><p >@{{ processDailyParticipant.remain }}</p></td>
                                 <td v-if="processDailyParticipant.rowspan" :rowspan="processDailyParticipant.rowspan">
-                                    @can("二次加工管理-登记工时")<button v-if="processDailyParticipant.isAddProcessDailyParticipant && isShow.isAddProcessDailyParticipant" class="btn btn-sm btn-info" @click="addProcessDailyParticipant(processDailyParticipant);processDailyParticipant.isAddProcessDailyParticipant=false;">新增</button>
+                                    @can("二次加工管理-登记工时")<button v-if="processDailyParticipant.isAddProcessDailyParticipant && isShow.isAddProcessDailyParticipant" class="btn btn-sm btn-outline-info" @click="addProcessDailyParticipant(processDailyParticipant);processDailyParticipant.isAddProcessDailyParticipant=false;">新增</button>
                                     <button v-if="!processDailyParticipant.isAddProcessDailyParticipant" class="btn btn-sm btn-danger"
                                             @click="deleteProcessDailyParticipant($event,processDailyParticipant.daily_id,processDailyParticipant.user_detail_full_name,processDailyParticipant.isConfirmBtn);processDailyParticipant.isAddProcessDailyParticipant=true;">取消</button>
                                     @endcan
@@ -654,7 +654,7 @@
                         tempTip.show('获取登记工时数据发生了一些严重错误:'+err);
                     });
                     let processDailyParticipantsHtml=$("#addProcessDailyParticipants");
-                    if (process.count) $("#"+e+"-"+process.count).after(processDailyParticipantsHtml);
+                    if (process.is_multi_row) $("#"+e+"-2").after(processDailyParticipantsHtml);
                     else $("#"+e).after(processDailyParticipantsHtml)
                 },
                 //删除工时显示