|
|
@@ -106,14 +106,14 @@
|
|
|
</label>
|
|
|
</th>
|
|
|
<th>序号</th>
|
|
|
- <th>操作</th>
|
|
|
+ <th >操作</th>
|
|
|
<th>任务号</th>
|
|
|
<th>货主</th>
|
|
|
<th>单据类型</th>
|
|
|
<th>单据号</th>
|
|
|
<th>加工类型</th>
|
|
|
<th>预期数量</th>
|
|
|
- <th>教程</th>
|
|
|
+ <th class="text-center">教程</th>
|
|
|
<th>单价</th>
|
|
|
<th>提交日期</th>
|
|
|
<th>商品编码</th>
|
|
|
@@ -121,12 +121,21 @@
|
|
|
<th>实际数量</th>
|
|
|
<th>状态</th>
|
|
|
</tr>
|
|
|
- <tr v-for="(processOne,i) in processes">
|
|
|
+ <tr v-for="(processOne,i) in processes" :id="processOne.id">
|
|
|
<td>
|
|
|
<input class="checkItem" type="checkbox" :value="processOne.id" v-model="checkData">
|
|
|
</td>
|
|
|
<td class="text-muted">@{{ i+1 }}</td>
|
|
|
- <td>操作</td>
|
|
|
+ <td >
|
|
|
+ <p v-if="!processOne.openProcessHour && processOne.status=='驳回'" class="text-muted">已驳回</p>
|
|
|
+ <p v-if="!processOne.openProcessHour && processOne.status=='已完成'" class="text-success">已完成</p>
|
|
|
+ <button v-if="!processOne.openProcessHour && processOne.status=='待接单'" @click="processReject(processOne.id)" class="btn-sm btn-outline-dark pull-left">驳回</button>
|
|
|
+ <button v-if="!processOne.openProcessHour && processOne.status=='待接单'" @click="processReceive(processOne.id)" class="btn-sm btn-outline-primary pull-left">接单</button>
|
|
|
+ <button v-if="(processOne.status=='加工中' || processOne.status=='待加工') && !processOne.openProcessHour"
|
|
|
+ class="btn-sm btn-outline-info pull-left" @click="openProcessHour(processOne.id);processOne.openProcessHour=true;processOne.detailFolding=false">登记工时</button>
|
|
|
+ <button v-if="processOne.openProcessHour" @click="closeProcessHour(processOne.id);processOne.openProcessHour=false" class="btn-sm btn-dark pull-left">收起登记工时</button>
|
|
|
+ <button v-if="!processOne.openProcessHour && processOne.status=='待验收'" @click="processAccomplish(processOne.id)" class="btn-sm btn-outline-success pull-left">完成</button>
|
|
|
+ </td>
|
|
|
<td class="text-muted">@{{ processOne.code }}</td>
|
|
|
<td class="text-muted">@{{ processOne.owner_name }}</td>
|
|
|
<td class="text-muted">@{{ processOne.bill_type }}</td>
|
|
|
@@ -135,31 +144,33 @@
|
|
|
<td>@{{ processOne.amount }}</td>
|
|
|
<td>
|
|
|
<div class="text-center">
|
|
|
- <div v-if="processOne.tutorials && processOne.tutorialCount>1">
|
|
|
- <a href="javascript:;" @click="processOne.detailFolding=true">@{{processOne.tutorialCount}}个货主,点击展开明细</a>
|
|
|
- <table class="table table-sm">
|
|
|
+ <div v-if=" processOne.tutorials.length>1">
|
|
|
+ <a href="javascript:;" @click="processOne.detailFolding=true;processOne.openProcessHour=false;closeProcessHour(processOne.id)" v-if="!processOne.detailFolding">@{{processOne.tutorials.length}}个教程,点击展开明细</a>
|
|
|
+ <button class="btn-sm btn-outline-dark pull-left" href="javascript:;" @click="processOne.detailFolding=false" v-else>收起编辑</button>
|
|
|
+ <table class="table table-sm" v-if="processOne.detailFolding">
|
|
|
<tr>
|
|
|
<th>标题</th>
|
|
|
<th>货主</th>
|
|
|
<th>操作</th>
|
|
|
<th>创建时间</th>
|
|
|
</tr>
|
|
|
- <tr v-for="tutorial in processOne.tutorials">
|
|
|
+ <tr v-for="(tutorial,i) in processOne.tutorials">
|
|
|
<td class="text-info">@{{tutorial.name}}</td>
|
|
|
<td >@{{tutorial.owner_name}}</td>
|
|
|
<td>@can('二次加工管理-教程管理')@endcan</td>
|
|
|
<td >@{{tutorial.created_at}}</td>
|
|
|
</tr>
|
|
|
- <tr v-if="processOne.detailFolding && processOne.tutorialCount>1">
|
|
|
- <td colspan="8" class="text-center">
|
|
|
- <a href="javascript:;" @click="processOne.detailFolding=false">点击收起明细</a>
|
|
|
+ <tr>
|
|
|
+ <td colspan="4">
|
|
|
+ <button class="btn btn-info pull-left">新增或编辑关联教程</button>
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
</div>
|
|
|
- <div v-if="processOne.tutorialCount>0 && ! processOne.detailFolding">
|
|
|
+ <div v-if="processOne.tutorials.length==1 && !processOne.detailFolding">
|
|
|
<a v-for="tutorial in processOne.tutorials" class="text-info">@{{tutorial.name}}</a>
|
|
|
- <button class="btn btn-sm btn-outline-dark pull-right" >删</button>
|
|
|
+ <button class="btn-sm btn-outline-info pull-right">改</button>
|
|
|
+ <button class="btn-sm btn-outline-dark pull-right" >删</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</td>
|
|
|
@@ -170,6 +181,56 @@
|
|
|
<td>@{{ processOne.completed_amount }}</td>
|
|
|
<td class="text-muted">@{{ processOne.status }}</td>
|
|
|
</tr>
|
|
|
+ <tr v-if="processDailyParticipants.length>0">
|
|
|
+ <td colspan="2"></td>
|
|
|
+ <td colspan="16">
|
|
|
+ <table class="table-sm table-bordered table-condensed">
|
|
|
+ <tr class="bg-success">
|
|
|
+ <td>日期</td><td>当日产量</td>
|
|
|
+ <td>当日剩余</td>
|
|
|
+ <td colspan="2">操作</td>
|
|
|
+ <td>参与者</td>
|
|
|
+ <td>开始时间</td>
|
|
|
+ <td>结束时间</td>
|
|
|
+ <td>计时工资</td>
|
|
|
+ <td>计件工资</td>
|
|
|
+ <td>晚饭时间</td>
|
|
|
+ <td>计时工时</td>
|
|
|
+ <td>备注</td>
|
|
|
+ <td>打卡工时</td>
|
|
|
+ <td>工时差</td>
|
|
|
+ <td>计费工时</td>
|
|
|
+ <td>计件数量</td>
|
|
|
+ <td>审核</td>
|
|
|
+ <td>详情</td>
|
|
|
+ </tr>
|
|
|
+ <tr v-for="processDaily in processDailyParticipants" :id="'processDaily'+processDaily.id">
|
|
|
+ <td v-if="processDaily.rowspan" :rowspan="processDaily.rowspan"><p v-if="processDailies[processDaily.id]">@{{ processDailies[processDaily.id].time }}</p></td>
|
|
|
+ <td v-if="processDaily.rowspan" :rowspan="processDaily.rowspan"><p v-if="processDailies[processDaily.id]">@{{ processDailies[processDaily.id].output }}</p></td>
|
|
|
+ <td v-if="processDaily.rowspan" :rowspan="processDaily.rowspan"><p v-if="processDailies[processDaily.id]">@{{ processDailies[processDaily.id].remain }}</p></td>
|
|
|
+ <td v-if="processDaily.rowspan" :rowspan="processDaily.rowspan">
|
|
|
+ <button v-if="isAddProcessDailyParticipant" class="btn btn-sm btn-info" @click="addProcessDailyParticipant(processDaily.id);isAddProcessDailyParticipant=false;">新增</button>
|
|
|
+ <button v-if="!isAddProcessDailyParticipant" class="btn btn-sm btn-info" @click="addProcessDailyParticipant(processDaily.id);isAddProcessDailyParticipant=true;">取消</button>
|
|
|
+ </td>
|
|
|
+ <td></td>
|
|
|
+ <td>@{{ processDaily.user_name }}</td>
|
|
|
+ <td>@{{ processDaily.started_at }}</td>
|
|
|
+ <td>@{{ processDaily.ended_at }}</td>
|
|
|
+ <td>@{{ processDaily.hour_price }}</td>
|
|
|
+ <td>@{{ processDaily.unit_price }}</td>
|
|
|
+ <td>@{{ processDaily.dinner_duration }}</td>
|
|
|
+ <td>@{{ processDaily.hour_count }}</td>
|
|
|
+ <td>@{{ processDaily.remark }}</td>
|
|
|
+ <td>@{{ processDaily.hour }}</td>
|
|
|
+ <td>@{{ processDaily.diff }}</td>
|
|
|
+ <td>@{{ processDaily.billingHour }}</td>
|
|
|
+ <td>@{{ processDaily.unit_count }}</td>
|
|
|
+ <td>审核</td>
|
|
|
+ <td>详情</td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
</table>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -185,11 +246,11 @@
|
|
|
data:{
|
|
|
processes:[
|
|
|
@foreach($processes as $processOne)
|
|
|
- {code:'{{$processOne->code}}',owner_name:'{{$processOne->owner_name}}',bill_type:'{{$processOne->bill_type}}'
|
|
|
+ {id:'{{$processOne->id}}',code:'{{$processOne->code}}',owner_name:'{{$processOne->owner_name}}',bill_type:'{{$processOne->bill_type}}'
|
|
|
,wms_code:'{{$processOne->wms_code}}',process_method_name:'{{$processOne->process_method_name}}',amount:'{{$processOne->amount}}'
|
|
|
- ,tutorials:'{!! $processOne->tutorials !!}',tutorialCount:'{{count($processOne->tutorials)}}',unit_price:'{{$processOne->unit_price}}',created_at:'{{$processOne->created_at}}'
|
|
|
+ ,tutorials:{!! $processOne->tutorials !!},unit_price:'{{$processOne->unit_price}}',created_at:'{{$processOne->created_at}}'
|
|
|
,commodity_barcode:'{{$processOne->commodity_barcode}}',commodity_name:'{{$processOne->commodity_name}}',
|
|
|
- completed_amount:'{{$processOne->completed_amount}}',status:'{{$processOne->status}}',detailFolding:false},
|
|
|
+ completed_amount:'{{$processOne->completed_amount}}',status:'{{$processOne->status}}',detailFolding:false,openProcessHour:false,},
|
|
|
@endforeach
|
|
|
],
|
|
|
owners:[
|
|
|
@@ -199,6 +260,9 @@
|
|
|
],
|
|
|
checkData:[],
|
|
|
filterData:{paginate:50,date_start:'',date_end:'',owner_id:'',commodity_barcode:'',wms_code:'',status:''},
|
|
|
+ processDailies:[],
|
|
|
+ processDailyParticipants:[],
|
|
|
+ isAddProcessDailyParticipant:true,
|
|
|
},
|
|
|
watch:{
|
|
|
checkData:{
|
|
|
@@ -214,7 +278,6 @@
|
|
|
},
|
|
|
computed:{
|
|
|
isBeingFilterConditions:function(){
|
|
|
-
|
|
|
for(let key in this.filterData){
|
|
|
if(this.filterData[key]){
|
|
|
if(key==='paginate')continue;
|
|
|
@@ -231,6 +294,7 @@
|
|
|
$('#process').removeClass('d-none');
|
|
|
},
|
|
|
methods:{
|
|
|
+ //回显条件参数
|
|
|
initInputs:function(){
|
|
|
let data=this;
|
|
|
let uriParts =decodeURI(location.href).split("?");
|
|
|
@@ -245,10 +309,12 @@
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ //提交表单
|
|
|
submit:function(){
|
|
|
- var form = $("#optionSubmit");
|
|
|
+ let form = $("#optionSubmit");
|
|
|
form.submit();
|
|
|
},
|
|
|
+ //全选事件
|
|
|
checkAll(e){
|
|
|
if (e.target.checked){
|
|
|
this.processes.forEach((el,i)=>{
|
|
|
@@ -260,6 +326,7 @@
|
|
|
this.checkData = [];
|
|
|
}
|
|
|
},
|
|
|
+ //导出excel,因同步问题不使用formData
|
|
|
processExport(e){
|
|
|
let val=e;
|
|
|
let data=this.filterData;
|
|
|
@@ -276,6 +343,123 @@
|
|
|
data.owner_id+"&commodity_barcode="+data.commodity_barcode+"&wms_code="+data.wms_code+
|
|
|
"&status="+data.status;
|
|
|
}
|
|
|
+ },
|
|
|
+ //获取登记工时
|
|
|
+ openProcessHour(e){
|
|
|
+ let _this=this;
|
|
|
+ axios.post("{{url("process/getDailyParticipant")}}",{id:e})
|
|
|
+ .then(function (response) {
|
|
|
+ let processDailies=response.data;
|
|
|
+ for (let i=0;i<processDailies.length;i++){
|
|
|
+ let processDailyParticipants=processDailies[i].process_daily_participants;
|
|
|
+ if (!processDailyParticipants)continue;
|
|
|
+ for (let j=0;j<processDailyParticipants.length;j++){
|
|
|
+ let data={};
|
|
|
+ data['id']=processDailyParticipants[j].id;
|
|
|
+ data['started_at']=processDailyParticipants[j].started_at;
|
|
|
+ data['user_name']=processDailyParticipants[j].user_name;
|
|
|
+ data['ended_at']=processDailyParticipants[j].ended_at;
|
|
|
+ data['hour_price']=processDailyParticipants[j].hour_price;
|
|
|
+ data['unit_price']=processDailyParticipants[j].unit_price;
|
|
|
+ data['dinner_duration']=processDailyParticipants[j].dinner_duration;
|
|
|
+ data['hour_count']=processDailyParticipants[j].hour_count;
|
|
|
+ data['remark']=processDailyParticipants[j].remark;
|
|
|
+ data['hour']=processDailyParticipants[j].hour;
|
|
|
+ data['diff']=processDailyParticipants[j].diff;
|
|
|
+ data['billingHour']=processDailyParticipants[j].billingHour;
|
|
|
+ data['unit_count']=processDailyParticipants[j].unit_count;
|
|
|
+ data['process_id']=processDailies[i].process_id;
|
|
|
+ if (!_this.processDailies[processDailies[i].id]){
|
|
|
+ data['daily']=processDailies[i].id;
|
|
|
+ data['rowspan']=processDailyParticipants.length;
|
|
|
+ let obj={};
|
|
|
+ obj['time']=processDailies[i].time;
|
|
|
+ obj['output']=processDailies[i].output;
|
|
|
+ obj['remain']=processDailies[i].remain;
|
|
|
+ _this.processDailies[processDailies[i].id]=obj;
|
|
|
+ }
|
|
|
+ _this.processDailyParticipants.push(data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(_this.processDailyParticipants)
|
|
|
+ }).catch(function (err) {
|
|
|
+ console.log(err)
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //删除工时显示
|
|
|
+ closeProcessHour(e){
|
|
|
+ this.processDailies=[];
|
|
|
+ this.processDailyParticipants=[];
|
|
|
+ },
|
|
|
+ //新增参与人
|
|
|
+ addProcessDailyParticipant(e){
|
|
|
+ let html='<tr><td></td><td>@{{ processDaily.user_name}}</td>' +
|
|
|
+ '<td>@{{ processDaily.started_at }}</td><td>@{{ processDaily.ended_at }}</td>' +
|
|
|
+ '<td>@{{ processDaily.hour_price }}</td><td>@{{ processDaily.unit_price }}</td>' +
|
|
|
+ '<td>@{{ processDaily.dinner_duration }}</td><td>@{{ processDaily.hour_count }}</td>' +
|
|
|
+ '<td>@{{ processDaily.remark }}</td><td>@{{ processDaily.hour }}</td>' +
|
|
|
+ '<td>@{{ processDaily.diff }}</td><td>@{{ processDaily.billingHour }}</td>' +
|
|
|
+ '<td>@{{ processDaily.unit_count }}</td><td>审核</td>' +
|
|
|
+ '<td>详情</td></tr>';
|
|
|
+ this.processDailyParticipants.every(function (processDailyParticipant) {
|
|
|
+ if (processDailyParticipant.id==e){
|
|
|
+ processDailyParticipant.rowspan=(processDailyParticipant.rowspan)+1;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ });
|
|
|
+ $("#processDaily"+e).after(html);
|
|
|
+ },
|
|
|
+ //驳回
|
|
|
+ processReject(id){
|
|
|
+ let url="{{url('process/reject')}}"+"/"+id;
|
|
|
+ let _this=this;
|
|
|
+ axios.post(url)
|
|
|
+ .then(function (response) {
|
|
|
+ _this.processes.every(function (process) {
|
|
|
+ if (process.id==response.data.id){
|
|
|
+ process.status=response.data.status;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ });
|
|
|
+ }).catch(function (err) {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //接单
|
|
|
+ processReceive(id){
|
|
|
+ let url="{{url('process/receive')}}"+"/"+id;
|
|
|
+ let _this=this;
|
|
|
+ axios.post(url)
|
|
|
+ .then(function (response) {
|
|
|
+ _this.processes.every(function (process) {
|
|
|
+ if (process.id==response.data.id){
|
|
|
+ process.status=response.data.status;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ });
|
|
|
+ }).catch(function (err) {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //完成
|
|
|
+ processAccomplish(id){
|
|
|
+ let url="{{url('process/accomplish')}}"+"/"+id;
|
|
|
+ let _this=this;
|
|
|
+ axios.post(url)
|
|
|
+ .then(function (response) {
|
|
|
+ _this.processes.every(function (process) {
|
|
|
+ if (process.id==response.data.id){
|
|
|
+ process.status=response.data.status;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ });
|
|
|
+ }).catch(function (err) {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
});
|