| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240 |
- @extends('layouts.app')
- @section('title')二次加工管理@endsection
- @section('content')
- <span id="nav2">
- @component('process.menu')@endcomponent
- </span>
- <div class="d-none" id="process">
- <div class="container-fluid mt-3">
- <div>
- <form method="GET" action="{{url('process/')}}" style="margin-top: 1%" id="optionSubmit">
- <table class="table table-sm table-bordered text-nowrap ">
- <tr v-if="isBeingFilterConditions">
- <td colspan="10">
- <div class="col" style="padding:0">
- <a href="{{url('process')}}"><span class="btn btn-warning text-dark">清除过滤条件</span></a>
- </div></td>
- </tr>
- <tr>
- <td>
- <span class="text-muted">每页显示记录:</span>
- </td>
- <td colspan="9">
- <select name="paginate" v-model="filterData.paginate" class="tooltipTarget form-control-sm" style="vertical-align: middle" @change="submit">
- <option value="50">50行</option>
- <option value="100">100行</option>
- <option value="200">200行</option>
- <option value="500">500行</option>
- <option value="1000">1000行</option>
- </select></td>
- </tr>
- <tr>
- <td rowspan="2" >
- <span class="text-muted">根据条件过滤:</span>
- </td>
- <td >
- <label for="date_start" style="width: 35px">时间:</label>
- <input id="date_start" name="date_start" v-model="filterData.date_start" type="date" class="form-control-sm ">
- </td>
- <td >
- <label> 客 户 :</label>
- <input type="text" class="form-control-sm tooltipTarget" placeholder="查找"
- style="width:70px" @input="owner_seek"
- title="输入关键词快速定位下拉列表,回车确定">
- <select name="owner_id" v-model="filterData.owner_id" @change="submit" class="form-control-sm tooltipTarget">
- <option > </option>
- <option v-for="owner in owners" :value="owner.id">@{{owner.name}}</option>
- </select>
- </td>
- <td>
- <label for="wms_code">单据号:</label>
- <input id="wms_code" name="wms_code" v-model="filterData.wms_code" class="form-control-sm">
- </td>
- <td colspan="6"></td>
- </tr>
- <tr>
- <td >
- <label for="date_end" style="width: 35px"></label>
- <input id="date_end" name="date_end" v-model="filterData.date_end" type="date" class="form-control-sm ">
- </td>
- <td>
- <label>商品条码:</label>
- <input name="commodity_barcode" v-model="filterData.commodity_barcode" class="form-control-sm">
- </td>
- <td >
- <label for="status"> 状 态 :</label>
- <select id="status" name="status" v-model="filterData.status" @change="submit" class="form-control-sm tooltipTarget">
- <option > </option>
- <option value="待接单">待接单</option>
- <option value="待加工">待加工</option>
- <option value="驳回">驳回</option>
- <option value="加工中">加工中</option>
- <option value="待验收">待验收</option>
- <option value="已完成">已完成</option>
- </select>
- </td>
- <td colspan="6">
- <input hidden type="submit" >
- </td>
- </tr>
- <tr>
- <td>
- <span class="text-muted">操作选定记录:</span>
- </td>
- <td colspan="9">
- <span class="dropdown">
- <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget" :class="[checkData>0?'btn-dark text-light':'']"
- data-toggle="dropdown" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出">
- 导出Excel
- </button>
- <div class="dropdown-menu">
- <a class="dropdown-item" @click="processExport(1)" href="javascript:">导出勾选内容</a>
- <a class="dropdown-item" @click="processExport(2)" href="javascript:">导出所有页</a>
- </div>
- </span>
- </td>
- </tr>
- </table>
- </form>
- </div>
- <!--新增教程关联-->
- <div style="top:25%" class="modal fade" id="addTutorial" tabindex="-1" role="dialog" aria-labelledby="addTutorial" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content" style="background-color: #d6e9f8">
- <div class="modal-header">
- <button type="button" class="close pull-right" data-dismiss="modal" aria-hidden="true">×</button>
- </div>
- <div class="modal-body m-auto">
- <table class="table-sm">
- <tr>
- <th>标题</th>
- <th><button class="btn btn-sm btn-outline-primary" @click="addTutorial()">新增教程</button></th>
- </tr>
- <tr v-for="tutorial in processTutorial.tutorials">
- <td><u @click="showTutorial(tutorial.id)" style="cursor:pointer">@{{tutorial.name}}</u></td>
- @can("二次加工管理-教程管理")<td><button @click="selectedTutorial(processTutorial.id,tutorial.id)" class="btn btn-sm btn-success pull-right">选择</button></td>@endcan
- </tr>
- </table>
- </div>
- </div><!-- /.modal-content -->
- </div><!-- /.modal -->
- </div>
- <!-- 显示教程-->
- <div class="modal fade" id="showTutorial" tabindex="-1" role="dialog" aria-labelledby="showTutorial" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close pull-right" data-dismiss="modal" aria-hidden="true">×</button>
- </div>
- <div class="modal-body custom-rich-text-content" id="content"></div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
- </div>
- </div><!-- /.modal-content -->
- </div><!-- /.modal -->
- </div>
- <!-- 修改modal -->
- <div data-backdrop="static" class="modal fade" id="updateModal" tabindex="-1" role="dialog" aria-labelledby="updateModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-dialog-centered" role="document">
- <div class="modal-content">
- <div class="modal-body">
- <div v-if="errors.user_id" class="row"><label class="col-3"></label><small class="text-danger col-7">@{{ errors.user_id }}</small></div>
- <div class="form-group row">
- <label for="initial_weight" class="col-3 col-form-label text-right">参与者</label>
- <div class="col-7">
- <input :class="{ 'is-invalid' : errors.user_id }" @change="verifyUserName($event,null,null)" type="text" class="form-control" autocomplete="off" v-model="processDailyParticipantOne.user_detail_full_name" >
- </div>
- </div>
- <div v-if="errors.started_at" class="row"><label class="col-3"></label><small class="text-danger col-7">@{{ errors.started_at[0] }}</small></div>
- <div class="form-group row">
- <label for="initial_weight" class="col-3 col-form-label text-right">开始时间</label>
- <div class="col-7">
- <input :class="{ 'is-invalid' : errors.started_at }" type="text" @input="hourFilter($event)" class="form-control" autocomplete="off" v-model="processDailyParticipantOne.started_at" >
- </div>
- </div>
- <div v-if="errors.ended_at" class="row"><label class="col-3"></label><small class="text-danger col-7">@{{ errors.ended_at[0] }}</small></div>
- <div class="form-group row">
- <label for="initial_weight" class="col-3 col-form-label text-right">结束时间</label>
- <div class="col-7">
- <input :class="{ 'is-invalid' : errors.ended_at }" type="text" @input="hourFilter($event)" class="form-control" autocomplete="off" v-model="processDailyParticipantOne.ended_at" >
- </div>
- </div>
- <div v-if="errors.hour_price" class="row"><label class="col-3"></label><small class="text-danger col-7">@{{ errors.hour_price[0] }}</small></div>
- <div class="form-group row">
- <label for="initial_weight" class="col-3 col-form-label text-right">计时工资</label>
- <div class="col-7">
- <input :class="{ 'is-invalid' : errors.hour_price }" type="text" class="form-control" autocomplete="off" v-model="processDailyParticipantOne.hour_price" >
- </div>
- </div>
- <div v-if="errors.unit_price" class="row"><label class="col-3"></label><small class="text-danger col-7">@{{ errors.unit_price[0] }}</small></div>
- <div class="form-group row">
- <label for="initial_weight" class="col-3 col-form-label text-right">计件工资</label>
- <div class="col-7">
- <input :class="{ 'is-invalid' : errors.unit_price }" type="text" class="form-control" autocomplete="off" v-model="processDailyParticipantOne.unit_price" >
- </div>
- </div>
- <div v-if="errors.dinner_duration" class="row"><label class="col-3"></label><small class="text-danger col-7">@{{ errors.dinner_duration[0] }}</small></div>
- <div class="form-group row">
- <label for="initial_weight" class="col-3 col-form-label text-right">晚饭时间</label>
- <div class="col-7">
- <select :class="{ 'is-invalid' : errors.dinner_duration }" v-model="processDailyParticipantOne.dinner_duration" class="form-control">
- <option value="0">无</option>
- <option value="30">30分钟</option>
- <option value="60">60分钟</option>
- </select>
- </div>
- </div>
- <div v-if="errors.hour_count" class="row"><label class="col-3"></label><small class="text-danger col-7">@{{ errors.hour_count[0] }}</small></div>
- <div class="form-group row">
- <label for="initial_weight" class="col-3 col-form-label text-right">计时工时</label>
- <div class="col-7">
- <input :class="{ 'is-invalid' : errors.hour_count }" type="text" class="form-control" autocomplete="off" v-model="processDailyParticipantOne.hour_count" >
- </div>
- </div>
- <div v-if="errors.unit_count" class="row"><label class="col-3"></label><small class="text-danger col-7">@{{ errors.unit_count[0] }}</small></div>
- <div class="form-group row">
- <label for="initial_weight" class="col-3 col-form-label text-right">计件数量</label>
- <div class="col-7">
- <input :class="{ 'is-invalid' : errors.unit_count }" type="text" class="form-control" autocomplete="off" v-model="processDailyParticipantOne.unit_count" >
- </div>
- </div>
- <div class="form-group row">
- <label for="initial_weight" class="col-3 col-form-label text-right">备注</label>
- <div class="col-7">
- <input type="text" class="form-control" autocomplete="off" v-model="processDailyParticipantOne.remark" >
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
- @can("二次加工管理-登记工时")<button v-if="isShow.isUpdateConfirmBtn" @click="submitUpdateProcessDailyParticipant()" class="btn btn-primary">提交更改</button>@endcan
- </div>
- </div><!-- /.modal-content -->
- </div><!-- /.modal -->
- </div>
- <!-- 多临时工选择(Modal) -->
- <div data-backdrop="static" style="top:25%" class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content" style="background-color: #d6e9f8">
- <div class="modal-body m-auto">
- <table class="table-sm">
- <tr>
- <th>姓名</th>
- <th>性别</th>
- <th>电话</th>
- <th>最近打卡时间</th>
- <th></th>
- </tr>
- <tr v-for="userLabor in userLabors" v-if="userLabor.user_labor">
- <td>@{{ userLabor.full_name }}</td>
- <td>@{{ userLabor.gender }}</td>
- <td>@{{ userLabor.mobile_phone }}</td>
- <td>@{{ userLabor.checked_at }}</td>
- <td><button @click="selectedUser(userLabor.user_id,userLabor.user_labor.default_hour_price)" class="btn btn-sm btn-success">选择</button></td>
- </tr>
- </table>
- </div>
- </div><!-- /.modal-content -->
- </div><!-- /.modal -->
- </div>
- <table class="table table-striped table-sm text-nowrap table-hover">
- <tr>
- <th>
- <label for="all">
- <input id="all" type="checkbox" @click="checkAll($event)">全选
- </label>
- </th>
- <th>序号</th>
- <th >操作</th>
- <th>任务号</th>
- <th>货主</th>
- <th>加工类型</th>
- <th>预期数量</th>
- <th class="text-center">教程</th>
- <th>单价</th>
- <th>完成数量</th>
- <th>提交日期</th>
- <th>状态</th>
- <th>单据类型</th>
- <th>单据号</th>
- <th>本单数量</th>
- <th>商品条码</th>
- <th>商品名称 </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">
- <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">
- <p v-if="!processOne.openProcessHour && processOne.status=='驳回'" class="text-muted">已驳回</p>
- <p v-if="!processOne.openProcessHour && processOne.status=='已完成'" class="text-success">已完成</p>
- @can("二次加工管理-接单与驳回")
- <button v-if="!processOne.openProcessHour && processOne.status=='待接单'" @click="processEdit(processOne.id)" class="btn btn-sm btn-outline-info pull-left">编辑</button>
- <button v-if="!processOne.openProcessHour && processOne.status=='待接单'" @click="processReject(processOne.id)" class="btn btn-sm btn-outline-dark pull-left">驳回</button>
- <button v-if="!processOne.openProcessHour && processOne.status=='待接单'" @click="processReceive(processOne.id)" class="btn btn-sm btn-outline-primary pull-left">接单</button>@endcan
- @can("二次加工管理-登记工时")<button v-if="(processOne.status=='加工中' || processOne.status=='待加工') && !processOne.openProcessHour"
- class="btn btn-sm btn-outline-info pull-left" @click="openProcessHour(processOne);processOne.openProcessHour=true;processOne.detailFolding=false">登记工时</button>
- <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">
- <div class="text-center" v-if="processOne.tutorials">
- <div v-if=" processOne.tutorials.length>0">
- <a href="javascript:;" @click="processOne.detailFolding=true;processOne.openProcessHour=false;closeProcessHour(processOne.id)" v-if="!processOne.detailFolding">@{{processOne.tutorials.length}}个教程,点击展开明细</a>
- <div v-else><button class="btn btn-sm btn-outline-dark pull-left" href="javascript:;" @click="processOne.detailFolding=false" >收起编辑</button>
- <button @click="addTutorials(processOne.id,processOne.owner_id)" class="btn btn-sm btn-outline-info pull-left">新增与教程关联</button></div>
- <table class="table table-sm" v-if="processOne.detailFolding">
- <tr>
- <th>标题</th>
- <th>操作</th>
- <th>创建时间</th>
- </tr>
- <tr v-for="(tutorial,i) in processOne.tutorials">
- <td class="text-info"><u @click="showTutorial(tutorial.id)" style="cursor:pointer">@{{tutorial.name}}</u></td>
- <td>@can('二次加工管理-教程管理')
- <button @click="deleteTutorials(processOne.id,tutorial.id)" class="btn btn-sm btn-outline-danger pull-left" >删</button>
- @endcan</td>
- <td >@{{tutorial.created_at}}</td>
- </tr>
- <tr>
- <td colspan="4">
- </td>
- </tr>
- </table>
- </div>
- <div v-if="processOne.tutorials.length<1">
- <button @click="addTutorials(processOne.id,processOne.owner_id)" class="btn btn-sm btn-outline-info pull-left" >新增与教程关联</button>
- </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 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>
- <td class="text-muted">@{{ processOne.commodity_name }}</td>
- </tr>
- <tr id="addProcessDailyParticipants" v-show="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="processDailyParticipant in processDailyParticipants" :id="'processDailyParticipant'+processDailyParticipant.id">
- <td v-if="processDailyParticipant.rowspan" :rowspan="processDailyParticipant.rowspan"><p >@{{ processDailyParticipant.date }}</p></td>
- <td v-if="processDailyParticipant.rowspan" :rowspan="processDailyParticipant.rowspan">
- <div class="form-inline">
- <input :readonly="processDailyParticipant.readonly" v-model="processDailyParticipant.submitOutput"
- class="form-control col-sm-5 " @click="processDailyParticipant.id?processDailyParticipant.readonly=false:processDailyParticipant.readonly=true" type="text" />
- @can("二次加工管理-登记工时")<button class="btn btn-sm btn-success" v-if="! processDailyParticipant.readonly" @click="submitOutputData(processDailyParticipant.daily_id,processDailyParticipant.submitOutput,processDailyParticipant.id)">确定</button>
- <button class="btn btn-sm btn-danger" v-if="! processDailyParticipant.readonly" @click="processDailyParticipant.readonly=true;processDailyParticipant.submitOutput=processDailyParticipant.output">取消</button>
- @endcan
- </div>
- </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>
- <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
- </td>
- <td>
- @can("二次加工管理-登记工时")<button v-if="!processDailyParticipant.isAddProcessDailyParticipant && processDailyParticipant.isConfirmBtn" class="btn btn-sm btn-success" @click="submitProcessDailyParticipant(processDailyParticipant.daily_id)">确定</button>
- <button v-if="processDailyParticipant.id && processDailyParticipant.status=='未审核'" class="btn btn-sm btn-outline-info" @click="updateProcessDailyParticipant(processDailyParticipant)">改</button>
- @endcan
- </td>
- <td>
- <span v-if="!processDailyParticipant.user_detail_full_name && processDailyParticipant.isAddProcessDailyParticipant==false" >
- <input :class="{ 'is-invalid' : errors.user_id }" :data-original-title="errors.user_id ? errors.user_id : ''" :id="processDailyParticipant.daily_id+'user_detail_full_name'" class="form-control tooltipTargetError" style="width: 100px" type="text" @change="verifyUserName($event,processDailyParticipant.daily_id,processDailyParticipant.isConfirmBtn)">
- <input hidden :id="processDailyParticipant.daily_id+'user_id'"/>
- </span><span v-else>@{{ processDailyParticipant.user_detail_full_name }}</span></td>
- <td>
- <span v-if="!processDailyParticipant.user_detail_full_name && processDailyParticipant.isAddProcessDailyParticipant==false" >
- <input :class="{ 'is-invalid' : errors.started_at }" :data-original-title="errors.started_at ? errors.started_at[0] : ''" :id="processDailyParticipant.daily_id+'started_at'" value="09:00" class="form-control tooltipTargetError" style="width:70px" type="text" @input="hourFilter($event)">
- </span><span v-else> @{{ processDailyParticipant.started_at }}</span></td>
- <td>
- <span v-if="!processDailyParticipant.user_detail_full_name && processDailyParticipant.isAddProcessDailyParticipant==false" >
- <input :class="{ 'is-invalid' : errors.ended_at }" :data-original-title="errors.ended_at ? errors.ended_at[0] : ''" :id="processDailyParticipant.daily_id+'ended_at'" value="18:00" class="form-control tooltipTargetError" style="width:70px" type="text" @input="hourFilter($event)">
- </span><span v-else> @{{ processDailyParticipant.ended_at }}</span></td>
- <td><span v-if="!processDailyParticipant.user_detail_full_name && processDailyParticipant.isAddProcessDailyParticipant==false">
- <input :class="{ 'is-invalid' : errors.hour_price }" :data-original-title="errors.hour_price ? errors.hour_price[0] : ''" :id="processDailyParticipant.daily_id+'hour_price'" class="form-control tooltipTargetError" style="width:70px" type="text">
- </span><span v-else>@{{ processDailyParticipant.hour_price }}</span></td>
- <td>
- <span v-if="!processDailyParticipant.user_detail_full_name && processDailyParticipant.isAddProcessDailyParticipant==false">
- <input :class="{ 'is-invalid' : errors.unit_price }" :data-original-title="errors.unit_price ? errors.unit_price[0] : ''" :id="processDailyParticipant.daily_id+'unit_price'" class="form-control tooltipTargetError" style="width:70px" type="text">
- </span><span v-else>@{{ processDailyParticipant.unit_price }}</span></td>
- <td>
- <span v-if="!processDailyParticipant.user_detail_full_name && processDailyParticipant.isAddProcessDailyParticipant==false">
- <select :class="{ 'is-invalid' : errors.dinner_duration }" :data-original-title="errors.dinner_duration ? errors.dinner_duration[0] : ''" :id="processDailyParticipant.daily_id+'dinner_duration'" class="form-control tooltipTargetError" style="width:80px">
- <option value="0">无</option>
- <option value="30">30分钟</option>
- <option value="60">60分钟</option>
- </select>
- </span><span v-else>@{{ processDailyParticipant.dinner_duration }}</span></td>
- <td>
- <span v-if="!processDailyParticipant.user_detail_full_name && processDailyParticipant.isAddProcessDailyParticipant==false">
- <input :class="{ 'is-invalid' : errors.hour_count }" :data-original-title="errors.hour_count ? errors.hour_count[0] : ''" :id="processDailyParticipant.daily_id+'hour_count'" value="8" class="form-control tooltipTargetError" style="width:70px" type="text" >
- </span><span v-else>@{{ processDailyParticipant.hour_count }}</span></td>
- <td>
- <span v-if="!processDailyParticipant.user_detail_full_name && processDailyParticipant.isAddProcessDailyParticipant==false">
- <input :class="{ 'is-invalid' : errors.unit_count }" :data-original-title="errors.unit_count ? errors.unit_count[0] : ''" :id="processDailyParticipant.daily_id+'unit_count'" class="form-control tooltipTargetError" style="width:70px" type="text">
- </span><span v-else>@{{ processDailyParticipant.unit_count }}</span></td>
- <td>
- <span v-if="!processDailyParticipant.user_detail_full_name && processDailyParticipant.isAddProcessDailyParticipant==false">
- <input :id="processDailyParticipant.daily_id+'remark'" class="form-control" style="width: 100px" type="text">
- </span><span v-else>@{{ processDailyParticipant.remark }}</span></td>
- <td class="text-danger">@{{ processDailyParticipant.hour }}</td>
- <td class="text-danger">@{{ processDailyParticipant.diff }}</td>
- <td class="text-danger">@{{ processDailyParticipant.billingHour }}</td>
- <td class="text-danger">
- @can("二次加工管理-登记工时-审核")<button @click="processDailyParticipantAudit(processDailyParticipant.id)" v-if="processDailyParticipant.status=='未审核'" class="btn btn-sm btn-outline-success">审核</button>@endcan
- <b v-else class="text-success">@{{ processDailyParticipant.status }}</b>
- </td>
- @can("二次加工管理-临时工资料管理")<td class="text-info"><u v-if="processDailyParticipant.user_detail_full_name" style="cursor:pointer" @click="showUserDetail(processDailyParticipant.user_id)">详情</u></td>@endcan
- </tr>
- </table>
- </td>
- </tr>
- </template>
- </table>
- {{$processes->appends($request)->links()}}
- </div>
- </div>
- </div>
- @endsection
- @section('lastScript')
- <script>
- new Vue({
- el:"#process",
- data:{
- participantInputting:{},
- 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}}'
- ,tutorials:{!! $processOne->tutorials !!},processesContents:{!! $processOne->processesContents !!},unit_price:'{{$processOne->unit_price}}',created_at:'{{$processOne->created_at}}',
- completed_amount:'{{$processOne->completed_amount}}',status:'{{$processOne->status}}',detailFolding:false,openProcessHour:false,},
- @endforeach
- ],
- processes:[],
- processesList:[],
- owners:[
- @foreach($owners as $owner)
- {!! $owner !!},
- @endforeach
- ],
- errors:{},
- checkData:[],
- filterData:{paginate:50,date_start:'',date_end:'',owner_id:'',commodity_barcode:'',wms_code:'',status:''},
- processDailies:[],
- processDailyParticipants:[],
- isShow:{
- isOpenProcessHour:false,isAddProcessDailyParticipant:true,isUpdateConfirmBtn:true,
- },
- userLabors:[],
- modalDaily_id:'',
- 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:[],},
- },
- watch:{
- checkData:{
- handler(){
- if (this.checkData.length === this.processes.length){
- document.querySelector('#all').checked = true;
- }else {
- document.querySelector('#all').checked = false;
- }
- },
- deep:true
- }
- },
- computed:{
- isBeingFilterConditions:function(){
- for(let key in this.filterData){
- if(this.filterData[key]){
- if(key==='paginate')continue;
- return true
- }
- }
- return false;
- },
- },
- mounted:function () {
- this.initInputs();
- this.resetProcessData();
- $(".tooltipTarget").tooltip({'trigger':'hover'});
- $('#process').removeClass('d-none');
- },
- methods:{
- //重组数据
- resetProcessData:function(){
- let _this=this;
- for (let i=0;i<this.processesContents.length;i++){
- let process=this.processesContents[i];
- if (process.processesContents.length<1){
- let processOne={};
- processOne['id']=process.id;
- processOne['code']=process.code;
- processOne['owner_name']=process.owner_name;
- processOne['process_method_name']=process.process_method_name;
- processOne['amount']=process.amount;
- processOne['tutorials']=process.tutorials;
- processOne['unit_price']=process.unit_price;
- processOne['created_at']=process.created_at;
- processOne['status']=process.status;
- processOne['completed_amount']=process.completed_amount;
- processOne['detailFolding']=false;
- processOne['openProcessHour']=false;
- this.processes.push(processOne);
- continue;
- }
- process.processesContents.every(function (processesContent,count) {
- let processOne={};
- if ((count+1)==process.processesContents.length){
- processOne['afterLocation'] = process.id+"-"+process.processesContents.length;
- }
- if (_this.processesList[process.code]) {
- processOne['bill_type'] = processesContent.bill_type;
- processOne['wms_code'] = processesContent.wms_code;
- processOne['thisAmount']=processesContent.amount;
- processOne['commodity_barcodes'] = processesContent.commodity ? processesContent.commodity.barcodes:'';
- processOne['commodity_name'] = processesContent.commodity_name;
- _this.processes.push(processOne);
- }else{
- _this.processesList[process.code]=process.id;
- processOne['rowspan']=process.processesContents.length;
- processOne['id']=process.id;
- processOne['code']=process.code;
- processOne['owner_name']=process.owner_name;
- processOne['owner_id']=process.owner_id;
- processOne['process_method_name']=process.process_method_name;
- processOne['tutorials']=process.tutorials;
- processOne['amount']=process.amount;
- processOne['unit_price']=process.unit_price;
- processOne['created_at']=process.created_at;
- processOne['status']=process.status;
- processOne['completed_amount']=process.completed_amount;
- processOne['detailFolding']=false;
- processOne['openProcessHour']=false;
- processOne['bill_type']=processesContent.bill_type;
- processOne['wms_code']=processesContent.wms_code;
- processOne['thisAmount']=processesContent.amount;
- processOne['commodity_barcodes']=processesContent.commodity ? processesContent.commodity.barcodes:'';
- processOne['commodity_name']=processesContent.commodity_name;
- processOne['count']=process.processesContents.length;
- _this.processes.push(processOne);
- }
- return true;
- });
- }
- },
- //回显条件参数
- initInputs:function(){
- let data=this;
- let uriParts =decodeURI(location.href).split("?");
- if(uriParts.length>1){
- let params = uriParts[1].split('&');
- params.forEach(function(paramPair){
- let pair=paramPair.split('=');
- let key = pair[0], val = pair[1];
- if (val!=="+"){
- $('input[name="'+key+'"]').val(val);
- $('select[name="'+key+'"]').val(val);
- decodeURI(data.filterData[key]=val);
- }
- });
- }
- },
- //提交表单
- submit:function(){
- let form = $("#optionSubmit");
- form.submit();
- },
- //全选事件
- checkAll(e){
- if (e.target.checked){
- this.processes.forEach((el,i)=>{
- if (this.checkData.indexOf(el.id) == '-1'){
- this.checkData.push(el.id);
- }
- });
- }else {
- this.checkData = [];
- }
- },
- //导出excel,因同步问题不使用formData
- processExport(e){
- let val=e;
- let data=this.filterData;
- if (val==1){
- if (this.checkData&&this.checkData.length<=0){
- tempTip.setDuration(4000);
- tempTip.showSuccess('没有勾选任何记录');
- }else{
- location.href="{{url('process?checkSign=')}}"+this.checkData;
- }
- } else {
- location.href="{{url('process?checkSign=-1&date_start=')}}"+
- data.date_start+"&date_end="+data.date_end+"&owner_id="+
- data.owner_id+"&commodity_barcode="+data.commodity_barcode+"&wms_code="+data.wms_code+
- "&status="+data.status;
- }
- },
- //获取登记工时
- openProcessHour(process){
- let e=process.id;
- let _this=this;
- if (_this.isShow.isOpenProcessHour){
- _this.processes.every(function (process) {
- if (process.openProcessHour){
- process.openProcessHour=false;
- _this.processDailies=[];
- _this.processDailyParticipants=[];
- return false;
- }
- return true;
- });
- }else{
- _this.isShow.isOpenProcessHour=true;
- }
- axios.post("{{url("process/getDailyParticipant")}}",{id:e,amount:process.amount})
- .then(function (response) {
- let processDailies=response.data;
- for (let i=0;i<processDailies.length;i++){
- let processDailyParticipants=processDailies[i].process_daily_participants;
- if (processDailyParticipants.length<=0){
- let data={};
- data['daily_id']=processDailies[i].id;
- data['date']=processDailies[i].date;
- data['output']=processDailies[i].output;
- data['remain']=processDailies[i].remain;
- data['rowspan']=1;
- data['readonly']="true";
- data['isAddProcessDailyParticipant']="true";
- data['isConfirmBtn']="true";
- data['submitOutput']=processDailies[i].output;
- _this.processDailyParticipants.push(data);
- continue;
- }
- for (let j=0;j<processDailyParticipants.length;j++){
- let data={};
- data['id']=processDailyParticipants[j].id;
- data['status']=processDailyParticipants[j].status;
- data['started_at']=processDailyParticipants[j].started_at;
- data['user_detail_full_name']=processDailyParticipants[j].user_detail_full_name;
- data['user_id']=processDailyParticipants[j].user_id;
- 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;
- data['readonly']="true";
- if (!_this.processDailies[processDailies[i].id]){
- data['rowspan']=processDailyParticipants.length;
- data['daily_id']=processDailies[i].id;
- data['date']=processDailies[i].date;
- data['output']=processDailies[i].output;
- data['remain']=processDailies[i].remain;
- data['submitOutput']=processDailies[i].output;
- data['isAddProcessDailyParticipant']="true";
- data['isConfirmBtn']="true";
- _this.processDailies[processDailies[i].id]=processDailies[i].id;
- }
- _this.processDailyParticipants.push(data);
- }
- }
- }).catch(function (err) {
- tempTip.setDuration(5000);
- tempTip.show('获取登记工时数据发生了一些严重错误:'+err);
- });
- let processDailyParticipantsHtml=$("#addProcessDailyParticipants");
- if (process.count) $("#"+e+"-"+process.count).after(processDailyParticipantsHtml);
- else $("#"+e).after(processDailyParticipantsHtml)
- },
- //删除工时显示
- closeProcessHour(e){
- this.processDailies=[];
- this.processDailyParticipants=[];
- },
- //新增参与人
- addProcessDailyParticipant(processDailyParticipantOne){
- let id=processDailyParticipantOne.id;
- if (!id) return;
- let _this=this;
- _this.errors={};
- this.processDailyParticipants.every(function (processDailyParticipant,i) {
- if (processDailyParticipant.id==id){
- processDailyParticipant.rowspan++;
- let data={};
- data['readonly']="true";
- data['isAddProcessDailyParticipant']="true";
- data['isConfirmBtn']="true";
- data['id']=processDailyParticipant.id;
- data['user_id']=processDailyParticipant.user_id;
- data['status']=processDailyParticipant.status;
- data['started_at']=processDailyParticipant.started_at;
- data['user_detail_full_name']=processDailyParticipant.user_detail_full_name;
- data['ended_at']=processDailyParticipant.ended_at;
- data['hour_price']=processDailyParticipant.hour_price;
- data['unit_price']=processDailyParticipant.unit_price;
- data['dinner_duration']=processDailyParticipant.dinner_duration;
- data['hour_count']=processDailyParticipant.hour_count;
- data['remark']=processDailyParticipant.remark;
- data['hour']=processDailyParticipant.hour;
- data['diff']=processDailyParticipant.diff;
- data['billingHour']=processDailyParticipant.billingHour;
- data['unit_count']=processDailyParticipant.unit_count;
- data['process_id']=processDailyParticipant.process_id;
- _this.processDailyParticipants.splice(i+1,0,data);
- processDailyParticipant.id='';
- processDailyParticipant.status='';
- processDailyParticipant.started_at='';
- processDailyParticipant.user_detail_full_name='';
- processDailyParticipant.ended_at='';
- processDailyParticipant.hour_price='';
- processDailyParticipant.unit_price='';
- processDailyParticipant.dinner_duration='';
- processDailyParticipant.hour_count='';
- processDailyParticipant.remark='';
- processDailyParticipant.hour='';
- processDailyParticipant.diff='';
- processDailyParticipant.billingHour='';
- processDailyParticipant.unit_count='';
- processDailyParticipant.process_id='';
- return false;
- }
- return true;
- });
- _this.isShow.isAddProcessDailyParticipant=false;
- },
- //取消录入参与人
- deleteProcessDailyParticipant($event,daily_id,processDailyParticipant_name,isConfirmBtn){
- console.log($event,daily_id,processDailyParticipant_name,isConfirmBtn);
- if (!isConfirmBtn) {
- this.processDailyParticipants.every(function (processDailyParticipant) {
- if(processDailyParticipant.daily_id==daily_id){
- processDailyParticipant.isConfirmBtn=true; //放出隐藏确定按钮
- return false;
- }
- return true;
- });
- }
- let _this=this;
- this.processDailyParticipants.every(function (processDailyParticipant,i) {
- if(processDailyParticipant.daily_id==daily_id){
- if (!processDailyParticipant_name&&_this.processDailyParticipants[i+1]&&_this.processDailyParticipants[i+1].daily_id)return false;
- if (!_this.processDailyParticipants[i+1])return false;
- _this.processDailyParticipants[i+1].rowspan=(processDailyParticipant.rowspan)-1;
- _this.processDailyParticipants[i+1].daily_id=processDailyParticipant.daily_id;
- _this.processDailyParticipants[i+1].date=processDailyParticipant.date;
- _this.processDailyParticipants[i+1].output=processDailyParticipant.output;
- _this.processDailyParticipants[i+1].remain=processDailyParticipant.remain;
- _this.processDailyParticipants[i+1].submitOutput=processDailyParticipant.submitOutput;
- _this.processDailyParticipants.splice(i,1);
- return false;
- }
- return true;
- });
- _this.isShow.isAddProcessDailyParticipant=true;
- },
- //驳回
- processReject(id){
- if(!confirm('确定驳回该单吗?')){return};
- 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;
- });
- tempTip.setDuration(3000);
- tempTip.showSuccess('驳回成功!');
- }).catch(function (err) {
- tempTip.setDuration(5000);
- tempTip.show('驳回二次加工单发生了一些严重错误:'+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;
- });
- tempTip.setDuration(3000);
- tempTip.showSuccess('接单成功!');
- }).catch(function (err) {
- tempTip.setDuration(5000);
- tempTip.show('接单时发生了一些严重错误:'+err);
- })
- },
- //完成
- processAccomplish(id){
- if(!confirm('确定完成验收吗?')){return};
- 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;
- process.completed_amount=response.data.completed_amount;
- return false;
- }
- return true;
- });
- tempTip.setDuration(3000);
- tempTip.showSuccess('验收完成!');
- }).catch(function (err) {
- tempTip.setDuration(5000);
- tempTip.show('验收时发生了一些严重错误:'+err);
- })
- },
- //定位客户
- owner_seek:function (e) {
- let _this=this;
- let $val=e.target.value;
- if($val==='')_this.filterData.owner_id='';
- else
- _this.owners.forEach(function (owner) {
- if (owner.name.includes($val)){
- _this.filterData.owner_id=owner.id;
- }
- });
- },
- //修改每日产量
- submitOutputData(daily_id,data,id){
- let url="{{url('process/updateDailyOutput')}}";
- let _this=this;
- axios.post(url,{id:daily_id,output:data})
- .then(function (response) {
- if (response.data.status=="error"){
- tempTip.setDuration(3000);
- tempTip.show('输入有误:'+response.data.data.output);
- }
- if (response.data.status=="success"){
- let processDailies=response.data.data;
- _this.processDailyParticipants.every(function (processDailyParticipant) {
- if (processDailyParticipant.id==id) {
- processDailyParticipant.readonly=true;
- }
- processDailies.every(function (processDaily) {
- if (processDailyParticipant.date==processDaily.date){
- processDailyParticipant.output=processDaily.output;
- processDailyParticipant.remain=processDaily.remain;
- return false;
- }
- return true;
- });
- return true;
- });
- if (response.data.process) {
- _this.processes.every(function (process) {
- if(process.id==response.data.process){
- process.status="待验收";
- return false;
- }
- return true;
- });
- }
- tempTip.setDuration(3000);
- tempTip.showSuccess('每日产量修改成功!');
- }
- }).catch(function (err) {
- tempTip.setDuration(5000);
- tempTip.show('修改每日产量发生了一些严重错误:'+err);
- });
- },
- //验证临时工
- verifyUserName(e,daily_id,isConfirmBtn){
- let user=e.target.value;
- let _this=this;
- axios.post('{{url('process/verifyUserName')}}',{userName:user})
- .then(function (response) {
- //修改时验证
- if (!daily_id){
- //验证失败
- if(response.data.length<1){
- _this.isShow.isUpdateConfirmBtn=false;
- _this.errors['user_id']="查无此人,请检查您的输入";
- return;
- }
- //验证成功且结果仅有一个
- if (response.data.user_id){
- _this.isShow.isUpdateConfirmBtn=true;
- _this.errors['user_id']="";
- _this.processDailyParticipantOne.user_id=response.data.user_id;
- return;
- }
- //验证成功多结果
- if (response.data.length>1){
- _this.userLabors=response.data;
- $("#myModal").modal('show');
- return;
- }
- }
- //验证失败
- if(response.data.length<1){
- _this.processDailyParticipants.every(function (processDailyParticipant) {
- if(processDailyParticipant.daily_id==daily_id){
- _this.errors['user_id']="查无此人,请检查您的输入";
- setTimeout(function(){
- $(".tooltipTargetError").tooltip('show');
- },1);
- processDailyParticipant.isConfirmBtn=false; //验证失败隐藏确定按钮
- return false;
- }
- return true;
- });
- return;
- }
- //按钮被隐藏则放出
- if (!isConfirmBtn){
- _this.processDailyParticipants.every(function (processDailyParticipant) {
- if(processDailyParticipant.daily_id==daily_id){
- processDailyParticipant.isConfirmBtn=true; //验证失败隐藏确定按钮
- return false;
- }
- return true;
- });
- }
- _this.modalDaily_id=daily_id;
- //验证成功且结果仅有一个
- if (response.data.user_id){
- _this.errors['user_id']="";
- $("#"+daily_id+"user_id").val(response.data.user_id);
- $("#"+daily_id+"hour_price").val(response.data.user_labor.default_hour_price);
- }
- //验证成功多结果
- if (response.data.length>1){
- _this.userLabors=response.data;
- $("#myModal").modal('show');
- }
- }).catch(function (err) {
- tempTip.setDuration(5000);
- tempTip.show('验证临时工发生了一些严重错误:'+err);
- })
- },
- //验证时间合法性
- hourFilter(e){
- datetimeRelating.verifyTime(e);
- },
- //提交参与人
- submitProcessDailyParticipant(e){
- let request={};
- request['user_id']=$("#"+e+"user_id").val();
- request['started_at']=$("#"+e+"started_at").val();
- request['ended_at']=$("#"+e+"ended_at").val();
- let hour_price=$("#"+e+"hour_price").val();
- if (hour_price) request['hour_price']=hour_price;
- let unit_price=$("#"+e+"unit_price").val();
- if (unit_price) request['unit_price']=unit_price;
- let dinner_duration=$("#"+e+"dinner_duration").val();
- if (dinner_duration) request['dinner_duration']=dinner_duration;
- let hour_count=$("#"+e+"hour_count").val();
- if (hour_count) request['hour_count']=hour_count;
- let unit_count=$("#"+e+"unit_count").val();
- if (unit_count) request['unit_count']=unit_count;
- let remark=$("#"+e+"remark").val();
- if (remark) request['remark']=remark;
- request['daily_id']=this.modalDaily_id;
- let _this=this;
- axios.post("{{url('process/shortProcessDailyParticipant')}}", request)
- .then(function (response) {
- if (response.data.status=="error"){
- tempTip.setDuration(3000);
- _this.errors=response.data.data;
- setTimeout(function(){
- $(".tooltipTargetError").tooltip('show');
- },1);
- return;
- }
- if (response.data.status=="success"){
- _this.processDailyParticipants.every(function (processDailyParticipant) {
- if (processDailyParticipant.daily_id==e){
- 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.user_id=response.data.data.user_id;
- 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;
- _this.isShow.isAddProcessDailyParticipant=true;
- return false;
- }
- return true;
- });
- if (response.data.process){
- _this.processes.every(function (process) {
- if (process.id==response.data.process){
- process.status="加工中";
- return false;
- }
- return true;
- });
- }
- tempTip.setDuration(3000);
- tempTip.showSuccess('参与人新增成功!');
- }
- }).catch(function (err) {
- tempTip.setDuration(5000);
- tempTip.show('新增参与人发生了一些严重错误:'+err);
- })
- },
- //同名临时工选择
- selectedUser(user_id,hour_price){
- $("#myModal").modal('hide');
- this.errors['user_id']="";
- this.processDailyParticipantOne['user_id']=user_id;
- this.processDailyParticipantOne['hour_price']=hour_price;
- this.isShow.isUpdateConfirmBtn=true;
- $("#"+this.modalDaily_id+"user_id").val(user_id);
- $("#"+this.modalDaily_id+"hour_price").val(hour_price);
- },
- //修改参与人
- updateProcessDailyParticipant(processDailyParticipant){
- this.errors={};
- this.processDailyParticipantOne['id']=processDailyParticipant.id;
- this.processDailyParticipantOne['user_detail_full_name']=processDailyParticipant.user_detail_full_name;
- this.processDailyParticipantOne['user_id']=processDailyParticipant.user_id;
- this.processDailyParticipantOne['started_at']=processDailyParticipant.started_at;
- this.processDailyParticipantOne['ended_at']=processDailyParticipant.ended_at;
- this.processDailyParticipantOne['hour_price']=processDailyParticipant.hour_price;
- this.processDailyParticipantOne['unit_price']=processDailyParticipant.unit_price;
- this.processDailyParticipantOne['dinner_duration']=processDailyParticipant.dinner_duration;
- this.processDailyParticipantOne['hour_count']=processDailyParticipant.hour_count;
- this.processDailyParticipantOne['unit_count']=processDailyParticipant.unit_count;
- this.processDailyParticipantOne['remark']=processDailyParticipant.remark;
- $("#updateModal").modal('show');
- },
- //提交修改
- submitUpdateProcessDailyParticipant(){
- 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');
- }
- }).catch(function (err) {
- tempTip.setDuration(5000);
- tempTip.show('修改参与人发生了一些严重错误:'+err);
- })
- },
- //登记工时参与人审核
- processDailyParticipantAudit(id){
- if(!confirm('审核后不能撤销及修改,确定通过审核吗?')){return};
- let _this=this;
- axios.post("{{url('process/processDailyParticipantAudit')}}"+"/"+id)
- .then(function (response) {
- if (response.data.success){
- _this.processDailyParticipants.every(function (processDailyParticipant) {
- if (processDailyParticipant.id==response.data.processDailyParticipant.id){
- processDailyParticipant.status=response.data.processDailyParticipant.status;
- return false;
- }
- return true;
- });
- tempTip.setDuration(3000);
- tempTip.showSuccess('参与人审核通过!');
- return;
- }
- tempTip.setDuration(3000);
- tempTip.show('参与人失败!');
- }).catch(function (err) {
- tempTip.setDuration(5000);
- tempTip.show('审核参与人发生了一些严重错误:'+err);
- });
- },
- //临时工详情
- showUserDetail(id){
- window.open("{{url('maintenance/userLabor')}}/"+id);
- },
- //显示教程
- showTutorial(id) {
- axios.post('{{url('maintenance/tutorial/showContent')}}'+"/"+id)
- .then(function (response) {
- if (response.data.success){
- $("#content").html(response.data.data);
- $("#showTutorial").modal('show');
- }
- }).catch(function (err) {
- tempTip.setDuration(3000);
- tempTip.show('获取教程失败!'+'网络错误:' + err);
- });
- },
- //新增教程
- addTutorials(id,owner_id){
- let _this=this;
- axios.post('{{url('process/getTutorials')}}'+"/"+id)
- .then(function (response) {
- if(response.data.success){
- _this.processTutorial.id=id;
- _this.processTutorial.owner_id=owner_id;
- _this.processTutorial.tutorials=response.data.data;
- $("#addTutorial").modal("show");
- return;
- }
- tempTip.setDuration(3000);
- tempTip.show('获取教程失败!未知错误:'+response.data );
- }).catch(function (err) {
- tempTip.setDuration(3000);
- tempTip.show('获取教程失败!'+'网络错误:' + err);
- });
- },
- //选择教程
- selectedTutorial(process_id,tutorial_id){
- let _this=this;
- axios.post('{{url('process/selectedTutorial')}}',{process_id:process_id,tutorial_id,tutorial_id})
- .then(function (response) {
- if (response.data.success){
- _this.processes.every(function (process) {
- if (process.id==process_id){
- process.tutorials.push(response.data.data);
- return false;
- }
- return true;
- });
- $("#addTutorial").modal("hide");
- tempTip.setDuration(3000);
- tempTip.showSuccess('添加成功!');
- return;
- }
- tempTip.setDuration(3000);
- tempTip.show('添加教程失败!发生错误:' + response.data.data);
- }).catch(function (err) {
- tempTip.setDuration(3000);
- tempTip.show('添加教程失败!'+'网络错误:' + err);
- });
- },
- //删除教程
- deleteTutorials(process_id,tutorial_id){
- let _this=this;
- axios.post('{{url('process/deleteTutorial')}}',{process_id:process_id,tutorial_id,tutorial_id})
- .then(function (response) {
- if (response.data.success){
- _this.processes.every(function (process) {
- if (process.id==process_id){
- process.tutorials.every(function (tutorial,i) {
- if (tutorial.id==tutorial_id) {
- process.tutorials.splice(i,1)
- return false;
- }
- return true;
- });
- return false;
- }
- return true;
- });
- tempTip.setDuration(3000);
- tempTip.showSuccess('删除成功!');
- return;
- }
- tempTip.setDuration(3000);
- tempTip.show('删除教程失败!发生错误:' + response.data.data);
- }).catch(function (err) {
- tempTip.setDuration(3000);
- tempTip.show('删除教程失败!'+'网络错误:' + err);
- } );
- },
- processEdit(id){
- location.href = "{{url('process')}}/"+id+"/edit";
- },
- //去往新增教程
- addTutorial(){
- window.open("{{url('maintenance/tutorial/create?owner_id=')}}"+this.processTutorial.owner_id);
- }
- },
- });
- </script>
- @endsection
|