index.blade.php 119 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685
  1. @extends('layouts.app')
  2. @section('title')二次加工管理@endsection
  3. @section('content')
  4. <span id="nav2">
  5. @component('process.menu')@endcomponent
  6. </span>
  7. <div class="d-none" id="process">
  8. <div class="container-fluid">
  9. <div>
  10. <form method="GET" action="{{url('process/')}}" id="optionSubmit">
  11. <table class="table table-sm table-bordered text-nowrap mb-0">
  12. <tr v-if="isBeingFilterConditions">
  13. <td colspan="10">
  14. <div class="col" style="padding:0">
  15. <a href="{{url('process')}}"><span class="btn btn-warning text-dark">清除过滤条件</span></a>
  16. </div></td>
  17. </tr>
  18. <tr>
  19. <td colspan="9">
  20. <select name="paginate" v-model="filterData.paginate" class="tooltipTarget form-control form-control-sm" style="vertical-align: middle;max-width: 100px" @change="submit">
  21. <option value="50">50行</option>
  22. <option value="100">100行</option>
  23. <option value="200">200行</option>
  24. <option value="500">500行</option>
  25. <option value="1000">1000行</option>
  26. </select></td>
  27. </tr>
  28. <tr>
  29. <td >
  30. <input id="date_start" name="date_start" style="max-width: 200px" v-model="filterData.date_start" :class="filterData.date_start?'bg-warning':''" type="date" class="form-control form-control-sm tooltipTarget" title="选择显示指定日期的起始时间">
  31. </td>
  32. <td >
  33. <div class="form-inline">
  34. <input type="text" class="form-control form-control-sm tooltipTarget" placeholder="客户"
  35. style="width:70px" @input="owner_seek"
  36. title="输入关键词快速定位下拉列表,回车确定">
  37. <select name="owner_id" v-model="filterData.owner_id" @change="submit" class="form-control form-control-sm tooltipTarget" title="选择要显示的客户" :class="filterData.owner_id?'bg-warning':''">
  38. <option > </option>
  39. <option v-for="owner in owners" :value="owner.id">@{{owner.name}}</option>
  40. </select></div>
  41. </td>
  42. <td>
  43. <input id="wms_code" name="wms_code" style="max-width: 200px" title="单据号:支持15内模糊搜索与15天外精确搜索" v-model="filterData.wms_code" class="form-control form-control-sm tooltipTarget" placeholder="单据号" :class="filterData.wms_code?'bg-warning':''">
  44. </td>
  45. <td>
  46. <select id="status" name="status" v-model="filterData.status" @change="submit" style="max-width: 100px" class="form-control form-control-sm tooltipTarget" :class="filterData.status?'bg-warning':''" >
  47. <option value="" selected>状态</option>
  48. <option value="待审核">待审核</option>
  49. <option value="待接单">待接单</option>
  50. <option value="待加工">待加工</option>
  51. <option value="已驳回">已驳回</option>
  52. <option value="加工中">加工中</option>
  53. <option value="待验收">待验收</option>
  54. <option value="交接完成">交接完成</option>
  55. </select>
  56. <input hidden name="is_accomplish" v-model="filterData.is_accomplish">
  57. </td>
  58. <td colspan="5"></td>
  59. </tr>
  60. <tr>
  61. <td >
  62. <input id="date_end" name="date_end" style="max-width: 200px" v-model="filterData.date_end" type="date" class="form-control form-control-sm tooltipTarget" title="选择显示指定日期的结束时间" :class="filterData.date_end?'bg-warning':''">
  63. </td>
  64. <td>
  65. <input name="commodity_barcode" style="max-width: 200px" title="商品条码:支持15内模糊搜索与15天外精确搜索" v-model="filterData.commodity_barcode" class="form-control form-control-sm tooltipTarget" placeholder="商品条码" :class="filterData.commodity_barcode?'bg-warning':''">
  66. </td>
  67. <td>
  68. <input name="code" style="max-width: 200px" title="任务号:支持15内模糊搜索与15天外精确搜索" v-model="filterData.code" class="form-control form-control-sm tooltipTarget" placeholder="任务号" :class="filterData.code?'bg-warning':''">
  69. </td>
  70. <td >
  71. <button class="btn btn-sm btn-outline-dark pull-left" type="submit">按条件搜索</button>
  72. </td>
  73. <td colspan="5"></td>
  74. </tr>
  75. <tr>
  76. <td colspan="9">
  77. <div class="form-inline">
  78. <span class="dropdown">
  79. <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget" :class="[checkData.length>0?'btn-dark text-light':'']"
  80. data-toggle="dropdown" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出">
  81. 导出Excel
  82. </button>
  83. <div class="dropdown-menu">
  84. <a class="dropdown-item" @click="processExport(1)" href="javascript:">导出勾选内容</a>
  85. <a class="dropdown-item" @click="processExport(2)" href="javascript:">导出所有页</a>
  86. </div>
  87. </span>
  88. <div class="form-check ml-4">
  89. <label class="form-check-label text-muted">
  90. <input v-if="filterData.is_accomplish" checked @click="is_checked($event)" type="checkbox" class="form-check-input">
  91. <input v-else @click="is_checked($event)" type="checkbox" class="form-check-input">显示交接完成的记录
  92. </label>
  93. </div>
  94. </div>
  95. </td>
  96. </tr>
  97. </table>
  98. </form>
  99. </div>
  100. <!--新增教程关联-->
  101. <div style="top:25%" class="modal fade" id="addTutorial" tabindex="-1" role="dialog" aria-labelledby="addTutorial" aria-hidden="true">
  102. <div class="modal-dialog">
  103. <div class="modal-content">
  104. <div class="modal-header m-1 p-0">
  105. <button type="button" class="close pr-4" data-dismiss="modal" aria-hidden="true">&times;</button>
  106. </div>
  107. <div class="modal-body m-auto">
  108. <table class="table-sm">
  109. <tr>
  110. <th>标题</th>
  111. <th><button class="btn btn-sm btn-outline-primary" @click="addTutorial()">新增教程</button></th>
  112. </tr>
  113. <tr v-for="tutorial in processTutorial.tutorials">
  114. <td><div style="cursor:pointer;overflow: hidden;width: 200px" @click="showTutorial(tutorial.id)" :title="tutorial.name" class="text-primary">@{{tutorial.name}}</div></td>
  115. @can("二次加工管理-教程管理")<td><button @click="selectedTutorial(processTutorial.id,tutorial.id)" class="btn btn-sm btn-success pull-right">选择</button></td>@endcan
  116. </tr>
  117. </table>
  118. </div>
  119. </div><!-- /.modal-content -->
  120. </div><!-- /.modal -->
  121. </div>
  122. <!-- 显示教程-->
  123. <div class="modal fade" id="showTutorial" tabindex="-1" role="dialog" aria-labelledby="showTutorial" aria-hidden="true">
  124. <div class="modal-dialog">
  125. <div class="modal-content">
  126. <div class="modal-header">
  127. <button type="button" class="close pull-right" data-dismiss="modal" aria-hidden="true">&times;</button>
  128. </div>
  129. <div class="modal-body custom-rich-text-content" id="content"></div>
  130. <div class="modal-footer">
  131. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  132. </div>
  133. </div><!-- /.modal-content -->
  134. </div><!-- /.modal -->
  135. </div>
  136. <!-- 修改modal -->
  137. <div data-backdrop="static" class="modal fade" id="updateModal" tabindex="-1" role="dialog" aria-labelledby="updateModalLabel" aria-hidden="true">
  138. <div class="modal-dialog modal-dialog-centered" role="document">
  139. <div class="modal-content">
  140. <div class="modal-body">
  141. <div v-if="errors.user_id" class="row"><label class="col-3"></label><small class="text-danger col-7">@{{ errors.user_id }}</small></div>
  142. <div class="form-group row">
  143. <label for="initial_weight" class="col-3 col-form-label text-right">参与者</label>
  144. <div class="col-7">
  145. <input :class="{ 'is-invalid' : errors.user_id }" @change="verifyUserName($event,null,null,processDailyParticipantOne)" type="text" class="form-control" autocomplete="off" v-model="processDailyParticipantOne.user_detail_full_name" >
  146. </div>
  147. </div>
  148. <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>
  149. <div class="form-group row">
  150. <label for="initial_weight" class="col-3 col-form-label text-right">开始时间</label>
  151. <div class="col-7">
  152. <input :class="{ 'is-invalid' : errors.started_at }" type="time" @input="hourFilter(processDailyParticipantOne,false)" class="form-control" autocomplete="off" v-model="processDailyParticipantOne.started_at" >
  153. </div>
  154. </div>
  155. <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>
  156. <div class="form-group row">
  157. <label for="initial_weight" class="col-3 col-form-label text-right">结束时间</label>
  158. <div class="col-7">
  159. <input :class="{ 'is-invalid' : errors.ended_at }" type="time" @input="hourFilter(processDailyParticipantOne,false)" class="form-control" autocomplete="off" v-model="processDailyParticipantOne.ended_at" >
  160. </div>
  161. </div>
  162. <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>
  163. <div class="form-group row">
  164. <label for="initial_weight" class="col-3 col-form-label text-right">计时工资</label>
  165. <div class="col-7">
  166. <input :class="{ 'is-invalid' : errors.hour_price }" type="text" class="form-control" autocomplete="off" v-model="processDailyParticipantOne.hour_price" >
  167. </div>
  168. </div>
  169. <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>
  170. <div class="form-group row">
  171. <label for="initial_weight" class="col-3 col-form-label text-right">计件工资</label>
  172. <div class="col-7">
  173. <input :class="{ 'is-invalid' : errors.unit_price }" type="text" class="form-control" autocomplete="off" v-model="processDailyParticipantOne.unit_price" >
  174. </div>
  175. </div>
  176. <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>
  177. <div class="form-group row">
  178. <label for="initial_weight" class="col-3 col-form-label text-right">晚饭时间</label>
  179. <div class="col-7">
  180. <select :class="{ 'is-invalid' : errors.dinner_duration }" :data-old-value="processDailyParticipantOne.dinner_duration" v-model="processDailyParticipantOne.dinner_duration"
  181. @change="updateDinnerDuration(processDailyParticipantOne,$event)" class="form-control">
  182. <option value="0">无</option>
  183. <option value="30">30分钟</option>
  184. <option value="60">60分钟</option>
  185. </select>
  186. </div>
  187. </div>
  188. <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>
  189. <div class="form-group row">
  190. <label for="initial_weight" class="col-3 col-form-label text-right">计时工时</label>
  191. <div class="col-7">
  192. <input :class="{ 'is-invalid' : errors.hour_count }" type="text" class="form-control" autocomplete="off" v-model="processDailyParticipantOne.hour_count" >
  193. </div>
  194. </div>
  195. <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>
  196. <div class="form-group row">
  197. <label for="initial_weight" class="col-3 col-form-label text-right">计件数量</label>
  198. <div class="col-7">
  199. <input :class="{ 'is-invalid' : errors.unit_count }" type="text" class="form-control" autocomplete="off" v-model="processDailyParticipantOne.unit_count" >
  200. </div>
  201. </div>
  202. <div class="form-group row">
  203. <label for="initial_weight" class="col-3 col-form-label text-right">备注</label>
  204. <div class="col-7">
  205. <input type="text" class="form-control" autocomplete="off" v-model="processDailyParticipantOne.remark" >
  206. </div>
  207. </div>
  208. </div>
  209. <div class="modal-footer">
  210. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  211. @can("二次加工管理-登记工时")<button v-if="isShow.isUpdateConfirmBtn" @click="submitUpdateProcessDailyParticipant()" class="btn btn-primary">提交更改</button>@endcan
  212. </div>
  213. </div><!-- /.modal-content -->
  214. </div><!-- /.modal -->
  215. </div>
  216. <!-- 多临时工选择(Modal) -->
  217. <div data-backdrop="static" style="top:25%" class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  218. <div class="modal-dialog">
  219. <div class="modal-content" style="background-color: #d6e9f8">
  220. <div class="modal-body m-auto">
  221. <table class="table-sm">
  222. <tr>
  223. <th>姓名</th>
  224. <th>性别</th>
  225. <th>电话</th>
  226. <th>最近打卡时间</th>
  227. <th></th>
  228. </tr>
  229. <tr v-for="userLabor in userLabors" v-if="userLabor.userLabor">
  230. <td>@{{ userLabor.full_name }}</td>
  231. <td>@{{ userLabor.gender }}</td>
  232. <td>@{{ userLabor.mobile_phone }}</td>
  233. <td>@{{ userLabor.checked_at }}</td>
  234. <td><button @click="selectedUser(userLabor)" class="btn btn-sm btn-success">选择</button></td>
  235. </tr>
  236. </table>
  237. </div>
  238. </div><!-- /.modal-content -->
  239. </div><!-- /.modal -->
  240. </div>
  241. <table class="table table-sm text-nowrap">
  242. <tr class="row-even">
  243. <th>
  244. <label for="all">
  245. <input id="all" type="checkbox" @click="checkAll($event)">全选
  246. </label>
  247. </th>
  248. <th>序号</th>
  249. <th>操作</th>
  250. <th>状态</th>
  251. <th>任务号</th>
  252. <th>经手人</th>
  253. <th>货主</th>
  254. <th>加工类型</th>
  255. <th>预期数量</th>
  256. <th class="text-center">教程</th>
  257. <th>单价</th>
  258. <th>完成数量</th>
  259. <th>提交日期</th>
  260. <th style="min-width: 200px">单据类型</th>
  261. <th style="min-width: 200px">单据号</th>
  262. <th style="min-width: 100px">本单数量</th>
  263. <th style="min-width: 200px">商品条码</th>
  264. <th style="min-width: 200px">商品名称 </th>
  265. <th>备注</th>
  266. <th></th>
  267. </tr>
  268. <template>
  269. <tr v-for="(processOne,i) in processes" :class="processOne.serial_number%2==0?'row-even':''" :id="processOne.id?processOne.id:processes[i-1].id+'-2'" :name="'process_table_'+processOne.serial_number" @mouseover="changeStyle('process_table_'+processOne.serial_number,true)" @mouseout="changeStyle('process_table_'+processOne.serial_number,false)">
  270. <td v-if="processOne.id" :rowspan="processOne.is_multi_row?2:''">
  271. <input class="checkItem" type="checkbox" :value="processOne.id" v-model="checkData">
  272. </td>
  273. <td v-if="processOne.id" class="text-muted" :rowspan="processOne.is_multi_row?2:''">@{{ processOne.serial_number }}</td>
  274. <td v-if="processOne.id" style="min-width:200px;" :rowspan="processOne.is_multi_row?2:''">
  275. @can("二次加工管理-审核")
  276. <button v-if="!processOne.openProcessHour && (processOne.status=='待审核' || processOne.status=='已驳回')" @mouseenter="processOne.buttonTexts.审核='审核'" @mouseleave="processOne.buttonTexts.审核='审'" class="btn btn-sm btn-outline-success" @click="audit(processOne)"><span>@{{ processOne.buttonTexts.审核 }}</span></button>@endcan
  277. @can("二次加工管理-回滚")
  278. <button v-if="!processOne.openProcessHour && processOne.status!='交接完成' && processOne.status!='待审核'" class="btn btn-sm btn-outline-dark" style="opacity: 0.65" @click="rollback(processOne.id)" @mouseenter="processOne.buttonTexts.回滚='回滚'" @mouseleave="processOne.buttonTexts.回滚='回'">@{{ processOne.buttonTexts.回滚 }}</button>@endcan
  279. @can("二次加工管理-质量验收")
  280. <button v-if="!processOne.openProcessHour && processOne.status=='待验收'" class="btn btn-sm btn-outline-success" @click="checkAndAccept(processOne)" @mouseenter="processOne.buttonTexts.质量验收='质量验收'" @mouseleave="processOne.buttonTexts.质量验收='验'">@{{processOne.buttonTexts.质量验收}}</button>@endcan
  281. @can("二次加工管理-接单与驳回")
  282. <button v-if="!processOne.openProcessHour && processOne.status=='待接单'" @click="processReject(processOne.id)" class="btn btn-sm btn-outline-dark" @mouseenter="processOne.buttonTexts.驳回='驳回'" @mouseleave="processOne.buttonTexts.驳回='驳'">@{{processOne.buttonTexts.驳回}}</button>
  283. <button v-if="!processOne.openProcessHour && processOne.status=='待接单'" @click="processReceive(processOne.id)" class="btn btn-sm btn-outline-primary" @mouseenter="processOne.buttonTexts.接单='接单'" @mouseleave="processOne.buttonTexts.接单='接'">@{{processOne.buttonTexts.接单}}</button>@endcan
  284. @can("二次加工管理-登记工时")<button :style="[{opacity:processOne.status=='交接完成'?'0.7':''},{transform:processOne.status=='交接完成'?'scale(0.85)':''}]" v-if="(processOne.status!='待审核' && processOne.status!='已驳回' && processOne.status!='待接单') && !processOne.openProcessHour"
  285. class="btn btn-sm btn-outline-info" @click="openProcessHour(processOne);processOne.openProcessHour=true;processOne.detailFolding=false" @mouseenter="processOne.buttonTexts.登记工时='登记工时'" @mouseleave="processOne.buttonTexts.登记工时='登'">@{{processOne.buttonTexts.登记工时}}</button>
  286. <button v-if="processOne.openProcessHour" @click="closeProcessHour(processOne.id);processOne.openProcessHour=false" class="btn btn-sm btn-dark">收起登记工时</button>
  287. <button v-if="!processOne.openProcessHour && processOne.status=='加工中'" @click="processAccomplish(processOne)" class="btn btn-sm btn-outline-success" style="opacity: 0.7" @mouseenter="processOne.buttonTexts.完成='完成'" @mouseleave="processOne.buttonTexts.完成='完'">@{{processOne.buttonTexts.完成}}</button>@endcan
  288. @can("二次加工管理-交接完成")<button v-if="!processOne.openProcessHour && processOne.status=='待交接'" @click="accomplish(processOne)" class="btn btn-sm btn-outline-success" @mouseenter="processOne.buttonTexts.交接完成='交接完成'" @mouseleave="processOne.buttonTexts.交接完成='交'">@{{processOne.buttonTexts.交接完成}}</button>@endcan
  289. @can("二次加工管理-编辑")
  290. <button v-if="!processOne.openProcessHour && (processOne.status=='待审核' ||processOne.status=='待接单' || processOne.status=='已驳回' || processOne.status=='加工中' || processOne.status=='待加工')" @click="processEdit(processOne.id)" class="btn btn-sm btn-outline-info" @mouseenter="processOne.buttonTexts.编辑='编辑'"
  291. @mouseleave="processOne.buttonTexts.编辑='编'" style="opacity: 0.6">@{{processOne.buttonTexts.编辑}}</button>
  292. @endcan
  293. </td>
  294. <td v-if="processOne.id" :rowspan="processOne.is_multi_row?2:''"
  295. :class="processOne.status==='已驳回' ? 'text-danger' : (processOne.status==='交接完成' ? 'text-success font-weight-bold' : 'text-muted')">@{{ processOne.status }}</td>
  296. <td v-if="processOne.id" class="text-muted" :rowspan="processOne.is_multi_row?2:''">
  297. <button style="transform: scale(0.85);opacity: 0.8;" class="btn btn-sm btn-info" @click="show(processOne.id)" @mouseenter="processOne.buttonTexts.查看单据='查看单据'" @mouseleave="processOne.buttonTexts.查看单据='查'">@{{ processOne.buttonTexts.查看单据 }}</button>
  298. @{{ processOne.code }}
  299. </td>
  300. <td v-if="processOne.id" class="text-muted" :rowspan="processOne.is_multi_row?2:''">
  301. <a href="#" v-if="processOne.operatorLogs.length>0" class="dropdown-toggle" data-toggle="dropdown">
  302. @{{ processOne.operatorLogs[0].user_name }}<b class="caret"></b>
  303. </a>
  304. <div style="position: absolute;width:320px;margin-left:-100px;background-color: white;max-height:150px ;overflow-y:auto" class="small mt-0 dropdown-menu">
  305. <table class="table table-sm table-striped table-bordered">
  306. <tr>
  307. <th>经手人</th>
  308. <th>操作</th>
  309. <th>时间</th>
  310. </tr>
  311. <tr v-for="operatorLog in processOne.operatorLogs">
  312. <td>@{{ operatorLog.user_name }}</td>
  313. <td class="text-danger font-weight-bold">@{{ operatorLog.operation }}</td>
  314. <td>@{{ operatorLog.created_at }}</td>
  315. </tr>
  316. </table>
  317. </div>
  318. </td>
  319. <td v-if="processOne.id" class="text-muted" :rowspan="processOne.is_multi_row?2:''">@{{ processOne.owner_name }}</td>
  320. <td v-if="processOne.id" :rowspan="processOne.is_multi_row?2:''" class="font-weight-bold text-danger">@{{ processOne.process_method_name }}</td>
  321. <td v-if="processOne.id" :rowspan="processOne.is_multi_row?2:''">@{{ processOne.amount }}</td>
  322. <td v-if="processOne.id" :rowspan="processOne.is_multi_row?2:''">
  323. <div class="" v-if="processOne.tutorials" {{--style="width: 200px;overflow:auto;"--}}>
  324. <div v-if=" processOne.tutorials.length>0">
  325. <u v-if="!processOne.detailFolding" @click="showTutorial(processOne.tutorials[0].id)" class="text-info" style="cursor:pointer;">@{{processOne.tutorials[0].name}}</u>
  326. <button href="javascript:;" class="btn btn-sm btn-outline-primary" @click="processOne.detailFolding=true;processOne.openProcessHour=false;closeProcessHour(processOne.id)" v-if="!processOne.detailFolding"><a v-if="processOne.tutorials.length>1">@{{processOne.tutorials.length}}条,展开</a><a v-else>编辑</a></button>
  327. <div v-else><button class="btn btn-sm btn-outline-dark pull-left" href="javascript:;" @click="processOne.detailFolding=false" >收起编辑</button>
  328. <button @click="addTutorials(processOne.id,processOne.owner_id)" class="btn btn-sm btn-outline-info pull-left">新增关联教程</button></div>
  329. <table class="table table-sm" v-if="processOne.detailFolding">
  330. <tr>
  331. <th>标题</th>
  332. <th>操作</th>
  333. <th>创建时间</th>
  334. </tr>
  335. <tr v-for="(tutorial,i) in processOne.tutorials">
  336. <td class="text-info"><u :title="tutorial.name" @click="showTutorial(tutorial.id)" style="cursor:pointer;">@{{tutorial.name}}</u></td>
  337. <td>@can('二次加工管理-教程管理')
  338. <button @click="deleteTutorials(processOne.id,tutorial.id)" class="btn btn-sm btn-outline-danger pull-left" >删</button>
  339. @endcan</td>
  340. <td >@{{tutorial.created_at}}</td>
  341. </tr>
  342. </table>
  343. </div>
  344. <div v-if="processOne.tutorials.length<1">
  345. <button @click="addTutorials(processOne.id,processOne.owner_id)" class="btn btn-sm btn-outline-info pull-left" >新增关联教程</button>
  346. </div>
  347. </div>
  348. </td>
  349. <td v-if="processOne.id" class="text-muted" :rowspan="processOne.is_multi_row?2:''">
  350. @can('二次加工管理-修改价格')
  351. <div v-if="processOne.status=='交接完成'">
  352. <div v-if="processOne.signs.length<=0">
  353. <div v-if="processOne.is_update_unit_price" >
  354. <input type="text" :value="processOne.unit_price" :id="'unit_price_'+processOne.id" class="form-control form-control-sm" style="min-width: 50px;">
  355. <button type="button" class="btn btn-sm btn-outline-success" @click="updateUnitPrice(processOne)">确定</button>
  356. <button type="button" class="btn btn-sm btn-outline-danger" @click="processOne.is_update_unit_price=false;">取消</button>
  357. </div>
  358. <input readonly @click="processOne.is_update_unit_price=true;" v-else style="cursor: pointer;min-width: 50px" :value="processOne.unit_price" class="form-control form-control-sm">
  359. </div>
  360. <div v-else @mouseleave="processOne.is_update_unit_price=false;" @mouseenter="processOne.is_update_unit_price=true;">
  361. <span class="flicker" style="cursor: move">@{{ processOne.unit_price }}</span>
  362. <div v-if="processOne.is_update_unit_price" style="position: absolute;width: 150px;background-color: white;white-space: normal;margin-left: -50px"
  363. @mouseleave="processOne.is_update_unit_price=false;" @mouseenter="processOne.is_update_unit_price=true;">
  364. <p class="text-center text-dark font-weight-bold">待确认</p>
  365. @can('二次加工管理-组长确认')<button v-if="!signs[processOne.code]['二次加工组确认']" class="btn btn-sm btn-outline-success" @click="verify(processOne,'workGroup')">组长确认</button>@endcan
  366. @can('二次加工管理-财务确认')<button v-if="!signs[processOne.code]['财务确认']" class="btn btn-sm btn-outline-success" @click="verify(processOne,'accountant')">财务确认</button>@endcan
  367. </div>
  368. </div>
  369. </div>
  370. <div v-else>@{{ processOne.unit_price }} </div>
  371. @endcan
  372. @cannot('二次加工管理-修改价格') @{{ processOne.unit_price }}@endcannot
  373. </td>
  374. <td v-if="processOne.id" :rowspan="processOne.is_multi_row?2:''">@{{ processOne.completed_amount }}</td>
  375. <td v-if="processOne.id" :rowspan="processOne.is_multi_row?2:''">@{{ processOne.created_at }}</td>
  376. <td colspan="5" style="margin:0;padding:0;position: relative">
  377. <table class="table table-sm table-striped" style="margin:0;padding:0;" v-if="processUnfold[processOne.code+processOne.id] || processOne.processesContents.length==1 ||
  378. (processOne.is_multi_row && (processOne.processesContents.length)-(processFullSum[processOne.code])==1) || (!processOne.id && processFullSum[processOne.code]==1)">
  379. <tr v-for="processesContent in processOne.processesContents"
  380. v-if="processOne.is_multi_row || !processOne.id ? !processOne.id ? processesContent.type=='成品单' :processesContent.type=='原料单' : true">
  381. <td style="width: 190px" class="text-muted" :class="processesContent.type=='原料单'?'td-warm':'td-cool'">@{{ processesContent.bill_type }} <span style="opacity: 0.75">(@{{ processesContent.type }})</span></td>
  382. <td style="width: 210px" class="text-muted" :class="processesContent.type=='原料单'?'td-warm':'td-cool'">@{{ processesContent.wms_code }}</td>
  383. <td style="width: 100px" class="text-muted" :class="processesContent.type=='原料单'?'td-warm':'td-cool'">@{{ processesContent.amount }}</td>
  384. <td style="width: 180px" class="text-muted" :class="processesContent.type=='原料单'?'td-warm':'td-cool'">
  385. <ul class="p-0 m-0 list-unstyled list-inline" v-if="processesContent.commodity">
  386. <li v-for="barcode in processesContent.commodity.barcodes"><small>@{{ barcode.code }}</small></li>
  387. </ul>
  388. </td>
  389. <td :title="processesContent.sign_mark?processesContent.sign_mark:processesContent.commodity_name" class="text-muted tooltipTarget" :class="processesContent.type=='原料单'?'td-warm':'td-cool'">
  390. <div style="width: 180px;overflow:hidden" :class="processesContent.bill_type=='原料单'?'td-warm':'td-cool'">@{{ processesContent.sign_mark?processesContent.sign_mark:processesContent.commodity_name }}</div></td>
  391. </tr>
  392. <tr v-if="processUnfold[processOne.code+processOne.id]">
  393. <td colspan="5">
  394. <div class="text-center">
  395. <b v-if="processUnfold[processOne.code+processOne.id]=='原料单'" style="cursor:pointer;" @click="close(processOne.code,processOne.id)">点击关闭原料单</b>
  396. <b v-if="processUnfold[processOne.code+processOne.id]=='成品单'" style="cursor:pointer;" @click="close(processOne.code,processOne.id)">点击关闭成品单</b></div>
  397. </td>
  398. </tr>
  399. </table>
  400. <div v-else :style="[{background: (!processOne.id || processOne.is_multi_row) ? (!processOne.id) ? '#e8eef6' :'rgb(246, 238, 232)' : (processOne.processesContents.length>0 ? ((processOne.processesContents[0].type=='成品单') ? '#e8eef6' : 'rgb(246, 238, 232)') :'')}
  401. ,{'-webkit-transform':'scale('+(1/Math.ceil(arrayFilter(processOne.processesContents,processOne).length/3))+')'},{height: (35*Math.ceil(arrayFilter(processOne.processesContents,processOne).length/3))+'px'}
  402. ,{width: (100*Math.ceil(arrayFilter(processOne.processesContents,processOne).length/3))+'%'},{'margin-left': (-100*((Math.ceil(arrayFilter(processOne.processesContents,processOne).length/3))-1)/2)+'%'}
  403. ,{'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'}]">
  404. <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},
  405. {'margin-left': arrayFilter(processOne.processesContents,processOne).length >3 ? (1*parseInt(arrayFilter(processOne.processesContents,processOne).length/3))+'px' : '0px'}]">
  406. <span>@{{ processesContent.bill_type }}</span>&nbsp;&nbsp;
  407. <span>@{{ processesContent.wms_code }}</span>&nbsp;&nbsp;
  408. <span>@{{ processesContent.amount }}</span>&nbsp;&nbsp;
  409. <span v-if="processesContent.commodity && processesContent.commodity.barcodes.length>0">
  410. @{{ processesContent.commodity.barcodes[0].code }}
  411. </span>&nbsp;&nbsp;
  412. <span :title="processesContent.sign_mark?processesContent.sign_mark:processesContent.commodity_name" class="text-muted tooltipTarget" style="max-width:100px;overflow:hidden;">@{{ processesContent.sign_mark?processesContent.sign_mark:processesContent.commodity_name }}</span>
  413. </div>
  414. </div>
  415. <div style="overflow: auto;zoom:1;position:absolute;margin-top: -35px;left:calc(50% - 50px);background-color: white" v-if="!processUnfold[processOne.code+processOne.id] && processOne.processesContents.length>1 &&
  416. ((processFullSum[processOne.code]!=processOne.processesContents.length && (processOne.processesContents.length)-(processFullSum[processOne.code])!=1 && ((processOne.is_multi_row || !processOne.id) ? (!processOne.id ? false :true) : true)) ||
  417. processFullSum[processOne.code] && processFullSum[processOne.code]>1 && ((processOne.is_multi_row || !processOne.id) ? (!processOne.id ? true :false) : true))" class="text-center">
  418. <button type="button" class="btn btn-sm btn-outline-primary" v-if="processFullSum[processOne.code]!=processOne.processesContents.length && (processOne.processesContents.length)-(processFullSum[processOne.code])!=1 && ((processOne.is_multi_row || !processOne.id) ? (!processOne.id ? false :true) : true)" @click="unfold(processOne.code,processOne.id,'原料单')">点击展开原料单</button>
  419. <button type="button" class="btn btn-sm btn-outline-primary" v-if="processFullSum[processOne.code] && processFullSum[processOne.code]>1 && ((processOne.is_multi_row || !processOne.id) ? (!processOne.id ? true :false) : true)" @click="unfold(processOne.code,processOne.id,'成品单')">点击展开成品单</button></div>
  420. </td>
  421. <td v-if="processOne.id" class="text-muted" :rowspan="processOne.is_multi_row?2:''"><div style="min-width: 500px;white-space: normal">@{{ processOne.remark }}</div></td>
  422. <td v-if="processOne.id" class="text-muted" :rowspan="processOne.is_multi_row?2:''">
  423. @can('二次加工管理-删除')<button type="button" class="btn btn-sm btn-outline-danger" @click="destroy(processOne.code,processOne.id)">删</button>@endcan
  424. </td>
  425. </tr>
  426. <tr id="addProcessDailyParticipants" v-show="processDailyParticipants.length>0">
  427. <td colspan="2"></td>
  428. <td colspan="16">
  429. <table class="table-sm table-bordered table-condensed">
  430. <tr class="text-success">
  431. <td>
  432. <button v-if="!is_update_date" @click="is_update_date='start_date';date=''"
  433. @mouseenter="dateTextMap.start_date='设定起始日期'" @mouseleave="dateTextMap.start_date='起'"
  434. type="button" class="btn btn-sm btn-outline-primary">@{{ dateTextMap.start_date }}</button>
  435. <button v-if="!is_update_date" @click="is_update_date='end_date';date=''" type="button"
  436. @mouseenter="dateTextMap.end_date='设定终止日期'" @mouseleave="dateTextMap.end_date='终'"
  437. class="btn btn-sm btn-outline-dark">@{{ dateTextMap.end_date }}</button>
  438. <div v-if="is_update_date">
  439. <input type="date" class="form-control form-control-sm" :class="is_update_date=='start_date' ? 'text-info border-info':''"
  440. style="width: 137px" v-model="date" :max="today"
  441. :min="is_update_date=='end_date' ? processDailyParticipants[(processDailyParticipants.length)-1].date : ''">
  442. <button type="button" @click="update_process_date(processDailyParticipants[0])" class="btn btn-sm btn-outline-success">确定</button>
  443. <button type="button" @click="is_update_date='';dateTextMap.end_date='终';dateTextMap.start_date='起'" class="btn btn-sm btn-outline-danger">取消</button>
  444. </div>
  445. </td>
  446. <td>当日产量</td>
  447. <td>当日剩余</td>
  448. <td colspan="2">操作</td>
  449. <td>参与者</td>
  450. <td>开始时间</td>
  451. <td>结束时间</td>
  452. <td>计时工资</td>
  453. <td>计件工资</td>
  454. <td>晚饭时间</td>
  455. <td>计时工时</td>
  456. <td>计件数量</td>
  457. <td>备注</td>
  458. <td>当日工资</td>
  459. {{--<td>审核</td>--}}
  460. <td>操作</td>
  461. </tr>
  462. <tr v-for="(processDailyParticipant,i) in processDailyParticipants" :id="'processDailyParticipant'+processDailyParticipant.id">
  463. <td v-if="processDailyParticipant.rowspan" :rowspan="processDailyParticipant.rowspan"><p >@{{ processDailyParticipant.date }}</p></td>
  464. <td v-if="processDailyParticipant.rowspan" :rowspan="processDailyParticipant.rowspan">
  465. <div class="form-inline">
  466. <input :readonly="processDailyParticipant.readonly" v-model="processDailyParticipant.submitOutput"
  467. class="form-control col-sm-5 " @click="processDailyParticipant.id?processDailyParticipant.readonly=false:processDailyParticipant.readonly=true" type="text" />
  468. @can("二次加工管理-登记工时")<button class="btn btn-sm btn-success" v-if="! processDailyParticipant.readonly" @click="submitOutputData(processDailyParticipant.daily_id,processDailyParticipant.submitOutput,processDailyParticipant.id)">确定</button>
  469. <button class="btn btn-sm btn-danger" v-if="! processDailyParticipant.readonly" @click="processDailyParticipant.readonly=true;processDailyParticipant.submitOutput=processDailyParticipant.output">取消</button>
  470. @endcan
  471. </div>
  472. </td>
  473. <td v-if="processDailyParticipant.rowspan" :rowspan="processDailyParticipant.rowspan"><p >@{{ processDailyParticipant.remain }}</p></td>
  474. <td v-if="processDailyParticipant.rowspan" :rowspan="processDailyParticipant.rowspan">
  475. @can("二次加工管理-登记工时")<button v-if="processDailyParticipant.isAddProcessDailyParticipant && isShow.isAddProcessDailyParticipant" class="btn btn-sm btn-outline-info" @click="addProcessDailyParticipant(processDailyParticipant);processDailyParticipant.isAddProcessDailyParticipant=false;">新增</button>
  476. <button v-if="!processDailyParticipant.isAddProcessDailyParticipant" class="btn btn-sm btn-danger"
  477. @click="deleteProcessDailyParticipant($event,processDailyParticipant.daily_id,processDailyParticipant.user_detail_full_name,processDailyParticipant.isConfirmBtn);processDailyParticipant.isAddProcessDailyParticipant=true;">取消</button>
  478. @endcan
  479. </td>
  480. <td>
  481. @can("二次加工管理-登记工时")<button v-if="!processDailyParticipant.isAddProcessDailyParticipant && processDailyParticipant.isConfirmBtn" class="btn btn-sm btn-success" @click="submitProcessDailyParticipant(processDailyParticipant.daily_id)">确定</button>
  482. <button v-if="processDailyParticipant.id" class="btn btn-sm btn-outline-info" @click="updateProcessDailyParticipant(processDailyParticipant)">改</button>
  483. @endcan
  484. </td>
  485. <td>
  486. <span v-if="!processDailyParticipant.user_detail_full_name && processDailyParticipant.isAddProcessDailyParticipant==false" >
  487. <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,processDailyParticipant)">
  488. <input hidden :id="processDailyParticipant.daily_id+'user_id'"/>
  489. </span><span v-else>@{{ processDailyParticipant.user_detail_full_name }}</span></td>
  490. <td>
  491. <span v-if="!processDailyParticipant.user_detail_full_name && processDailyParticipant.isAddProcessDailyParticipant==false" >
  492. <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:120px" type="time" @input="hourFilter(processDailyParticipant.daily_id,true)">
  493. </span><span v-else> @{{ processDailyParticipant.started_at }}</span></td>
  494. <td>
  495. <span v-if="!processDailyParticipant.user_detail_full_name && processDailyParticipant.isAddProcessDailyParticipant==false" >
  496. <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:120px" type="time" @input="hourFilter(processDailyParticipant.daily_id,true)">
  497. </span><span v-else> @{{ processDailyParticipant.ended_at }}</span></td>
  498. <td><span v-if="!processDailyParticipant.user_detail_full_name && processDailyParticipant.isAddProcessDailyParticipant==false">
  499. <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">
  500. </span><span v-else>@{{ processDailyParticipant.hour_price }}</span></td>
  501. <td>
  502. <span v-if="!processDailyParticipant.user_detail_full_name && processDailyParticipant.isAddProcessDailyParticipant==false">
  503. <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">
  504. </span><span v-else>@{{ processDailyParticipant.unit_price }}</span></td>
  505. <td>
  506. <span v-if="!processDailyParticipant.user_detail_full_name && processDailyParticipant.isAddProcessDailyParticipant==false">
  507. <select :class="{ 'is-invalid' : errors.dinner_duration }" @input="hourFilter(processDailyParticipant.daily_id,true)" :data-original-title="errors.dinner_duration ? errors.dinner_duration[0] : ''"
  508. :id="processDailyParticipant.daily_id+'dinner_duration'" class="form-control tooltipTargetError" style="width:80px">
  509. <option value="0">无</option>
  510. <option value="30">30分钟</option>
  511. <option value="60">60分钟</option>
  512. </select>
  513. </span><span v-else>@{{ processDailyParticipant.dinner_duration }}</span></td>
  514. <td>
  515. <span v-if="!processDailyParticipant.user_detail_full_name && processDailyParticipant.isAddProcessDailyParticipant==false">
  516. <input :class="{ 'is-invalid' : errors.hour_count }" :data-original-title="errors.hour_count ? errors.hour_count[0] : ''" :id="processDailyParticipant.daily_id+'hour_count'" :value="processDailyParticipant.hour_count?processDailyParticipant.hour_count:8" class="form-control tooltipTargetError" style="width:70px" type="text" >
  517. </span><span v-else>@{{ processDailyParticipant.hour_count }}</span></td>
  518. <td>
  519. <span v-if="!processDailyParticipant.user_detail_full_name && processDailyParticipant.isAddProcessDailyParticipant==false">
  520. <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">
  521. </span><span v-else>@{{ processDailyParticipant.unit_count }}</span></td>
  522. <td>
  523. <span v-if="!processDailyParticipant.user_detail_full_name && processDailyParticipant.isAddProcessDailyParticipant==false">
  524. <input :id="processDailyParticipant.daily_id+'remark'" class="form-control" style="width: 100px" type="text">
  525. </span><span v-else>@{{ processDailyParticipant.remark }}</span></td>
  526. <td class="text-danger">
  527. <div v-if="processDailyParticipant.unit_count || processDailyParticipant.hour_count">
  528. <span v-if="processDailyParticipant.unit_count">@{{ (processDailyParticipant.unit_count)*(processDailyParticipant.unit_price) }}</span>
  529. <span v-else>@{{ (processDailyParticipant.hour_count)*(processDailyParticipant.hour_price) }}</span>
  530. </div>
  531. </td>
  532. {{-- <td class="text-danger">
  533. @can("人事管理-任务审核")<button @click="processDailyParticipantAudit(processDailyParticipant.id)" v-if="processDailyParticipant.status=='未审核'" class="btn btn-sm btn-outline-success">审核</button>@endcan
  534. <b v-else class="text-success">@{{ processDailyParticipant.status }}</b>
  535. </td>--}}
  536. <td>
  537. <div v-if="processDailyParticipant.user_detail_full_name">
  538. @can("二次加工管理-临时工资料管理")<u class="text-info" style="cursor:pointer"
  539. @click="showUserDetail(processDailyParticipant.user_id)">详情</u>@endcan
  540. <button class="btn btn-sm btn-outline-danger" @click="deleteDailyParticipant(i)">删</button>
  541. </div>
  542. </td>
  543. </tr>
  544. </table>
  545. </td>
  546. </tr>
  547. </template>
  548. </table>
  549. {{$processes->appends($request)->links()}}
  550. </div>
  551. </div>
  552. @endsection
  553. @section('lastScript')
  554. <script>
  555. new Vue({
  556. el:"#process",
  557. data:{
  558. participantInputting:{},
  559. processes:[
  560. @foreach($processes as $processOne)
  561. {id:'{{$processOne->id}}',code:'{{$processOne->code}}',owner_name:'{{$processOne->owner_name}}',owner_id:'{{$processOne->owner_id}}',operatorLogs:{!! $processOne->operatorLogs !!},
  562. process_method_name:'{{$processOne->process_method_name}}',amount:'{{$processOne->amount}}',type:'{{$processOne->type}}',signs:{!!$processOne->signs !!}
  563. ,tutorials:{!! $processOne->tutorials !!},processesContents:{!! $processOne->processesContents !!},unit_price:'{{$processOne->unit_price}}',created_at:'{{$processOne->created_at}}',
  564. completed_amount:'{{$processOne->completed_amount}}',status:'{{$processOne->status}}',remark:'{{$processOne->remark}}',detailFolding:false,openProcessHour:false,is_multi_row:false,is_verifier_show:false,is_update_unit_price:false,
  565. buttonTexts:{'审核':'审','回滚':'回','编辑':'编','接单':'接','驳回':'驳','质量验收':'验','完成':'完','交接完成':'交','查看单据':'查','登记工时':'登'},
  566. },
  567. @endforeach
  568. ],
  569. processesList:[],
  570. owners:[
  571. @foreach($owners as $owner)
  572. {!! $owner !!},
  573. @endforeach
  574. ],
  575. errors:{},
  576. checkData:[],
  577. filterData:{paginate:50,date_start:'',date_end:'',owner_id:'',commodity_barcode:'',wms_code:'',status:'',is_accomplish:'',code:''},
  578. processDailies:[],
  579. processDailyParticipants:[],
  580. isShow:{
  581. isOpenProcessHour:false,isAddProcessDailyParticipant:true,isUpdateConfirmBtn:true,
  582. },
  583. userLabors:[],
  584. modalDaily_id:'',
  585. processDailyParticipantOne:{id:'',user_id:'',user_detail_full_name:'',started_at:"",ended_at:"",
  586. hour_price:'',unit_price:'',dinner_duration:'',hour_count:'',unit_count:'',remark:''},
  587. processTutorial:{id:'',owner_id:'',tutorials:[],},
  588. processUnfold:[],
  589. processFullSum:[],
  590. signs:[],
  591. is_update_date:false,
  592. date:'',
  593. today:'',
  594. dateTextMap:{'start_date':'起','end_date':'终'},
  595. },
  596. watch:{
  597. checkData:{
  598. handler(){
  599. if (this.checkData.length === this.processes.length){
  600. document.querySelector('#all').checked = true;
  601. }else {
  602. document.querySelector('#all').checked = false;
  603. }
  604. },
  605. deep:true
  606. }
  607. },
  608. computed:{
  609. isBeingFilterConditions:function(){
  610. for(let key in this.filterData){
  611. if(this.filterData[key]){
  612. if(key==='paginate' || key==='is_accomplish')continue;
  613. return true
  614. }
  615. }
  616. return false;
  617. },
  618. },
  619. mounted:function () {
  620. this.initInputs();
  621. this.resetProcessData();
  622. $(".tooltipTarget").tooltip({'trigger':'hover'});
  623. $('#process').removeClass('d-none');
  624. let today=new Date();
  625. this.today = today.getFullYear() + "-" + ((today.getMonth() + 1) < 10 ? "0"+(today.getMonth() + 1) : (today.getMonth() + 1)) + "-" + today.getDate();
  626. function focusin() {
  627. if(isJustBack())location.reload();
  628. }
  629. window.enterAt=(new Date()).getTime();
  630. function isJustBack() {
  631. let nowAt=(new Date()).getTime();
  632. return (nowAt-window.enterAt)<600;
  633. }
  634. if ("onfocusin" in document){//for IE
  635. document.onfocusin = focusin;
  636. } else {
  637. window.onfocus= focusin;
  638. }
  639. },
  640. methods: {
  641. arrayFilter: function (processesContents, process) {
  642. if (!process.is_multi_row && process.id) return processesContents;
  643. let array = [];
  644. let type = '成品单';
  645. if (process.id) type = '原料单';
  646. processesContents.forEach(function (processesContent) {
  647. if (processesContent.type === type) array.push(processesContent);
  648. });
  649. return array;
  650. },
  651. //重组数据
  652. resetProcessData: function () {
  653. let _this = this;
  654. let indexs = [];
  655. for (let i = 0; i < this.processes.length; i++) {
  656. let process = this.processes[i];
  657. _this.$set(_this.signs,process.code,[]);
  658. process.signs.forEach(function (sign) {
  659. _this.$set(_this.signs[process.code],sign.mark,true);
  660. });
  661. process.serial_number = i + 1;
  662. process.processesContents.every(function (processesContent) {
  663. if (processesContent.type === '成品单') _this.$set(_this.processFullSum, process.code, _this.processFullSum[process.code] ? _this.processFullSum[process.code] + 1 : 1);
  664. return true;
  665. });
  666. if (_this.processFullSum[process.code] && _this.processFullSum[process.code] !== 0 && _this.processFullSum[process.code] !== process.processesContents.length) {
  667. indexs.unshift(i);
  668. process.is_multi_row = true;
  669. }
  670. }
  671. indexs.forEach(function (index) {
  672. let processTemp = Object.assign({}, _this.processes[index]);
  673. processTemp.id = '';
  674. processTemp.is_multi_row = false;
  675. _this.processes.splice(index + 1, 0, processTemp);
  676. });
  677. },
  678. //回显条件参数
  679. initInputs: function () {
  680. let data = this;
  681. let uriParts = decodeURI(location.href).split("?");
  682. if (uriParts.length > 1) {
  683. let params = uriParts[1].split('&');
  684. params.forEach(function (paramPair) {
  685. let pair = paramPair.split('=');
  686. let key = pair[0], val = pair[1];
  687. if (val !== "+") {
  688. $('input[name="' + key + '"]').val(val);
  689. $('select[name="' + key + '"]').val(val);
  690. decodeURI(data.filterData[key] = val);
  691. }
  692. });
  693. }
  694. },
  695. //提交表单
  696. submit: function () {
  697. let form = $("#optionSubmit");
  698. form.submit();
  699. },
  700. //全选事件
  701. checkAll(e) {
  702. if (e.target.checked) {
  703. this.processes.forEach((el, i) => {
  704. if (this.checkData.indexOf(el.id) == '-1') {
  705. this.checkData.push(el.id);
  706. }
  707. });
  708. } else {
  709. this.checkData = [];
  710. }
  711. },
  712. //导出excel,因同步问题不使用formData
  713. processExport(e) {
  714. let val = e;
  715. let data = this.filterData;
  716. if (val == 1) {
  717. if (this.checkData && this.checkData.length <= 0) {
  718. tempTip.setDuration(4000);
  719. tempTip.showSuccess('没有勾选任何记录');
  720. } else {
  721. location.href = "{{url('process?checkSign=')}}" + this.checkData;
  722. }
  723. } else {
  724. location.href = "{{url('process?checkSign=-1&date_start=')}}" +
  725. data.date_start + "&date_end=" + data.date_end + "&owner_id=" +
  726. data.owner_id + "&commodity_barcode=" + data.commodity_barcode + "&wms_code=" + data.wms_code +
  727. "&status=" + data.status+"$is_accomplish="+data.is_accomplish;
  728. }
  729. },
  730. //获取登记工时
  731. openProcessHour(process) {
  732. let e = process.id;
  733. let _this = this;
  734. if (_this.isShow.isOpenProcessHour) {
  735. _this.processes.every(function (process) {
  736. if (process.openProcessHour) {
  737. process.openProcessHour = false;
  738. return false;
  739. }
  740. return true;
  741. });
  742. } else {
  743. _this.isShow.isOpenProcessHour = true;
  744. }
  745. axios.post("{{url("process/getDailyParticipant")}}", {id: e, amount: process.amount})
  746. .then(function (response) {
  747. let processDailies = response.data;
  748. _this.resetProcessDaily(processDailies,e);
  749. }).catch(function (err) {
  750. tempTip.setDuration(5000);
  751. tempTip.show('获取登记工时数据发生了一些严重错误:' + err);
  752. });
  753. let processDailyParticipantsHtml = $("#addProcessDailyParticipants");
  754. if (process.is_multi_row) $("#" + e + "-2").after(processDailyParticipantsHtml);
  755. else $("#" + e).after(processDailyParticipantsHtml)
  756. },
  757. //重组加工单加工日记录数据
  758. resetProcessDaily(processDailies,process_id){
  759. let _this=this;
  760. _this.processDailies = [];
  761. _this.processDailyParticipants = [];
  762. for (let i = 0; i < processDailies.length; i++) {
  763. let processDailyParticipants = processDailies[i].process_daily_participants;
  764. if (processDailyParticipants.length <= 0) {
  765. let data = {};
  766. data['process_id'] = process_id;
  767. data['daily_id'] = processDailies[i].id;
  768. data['date'] = processDailies[i].date;
  769. data['output'] = processDailies[i].output;
  770. data['remain'] = processDailies[i].remain;
  771. data['rowspan'] = 1;
  772. data['readonly'] = "true";
  773. data['isAddProcessDailyParticipant'] = "true";
  774. data['isConfirmBtn'] = "true";
  775. data['submitOutput'] = processDailies[i].output;
  776. _this.processDailyParticipants.push(data);
  777. continue;
  778. }
  779. for (let j = 0; j < processDailyParticipants.length; j++) {
  780. let data = {};
  781. data['id'] = processDailyParticipants[j].id;
  782. data['status'] = processDailyParticipants[j].status;
  783. data['started_at'] = processDailyParticipants[j].started_at;
  784. data['user_detail_full_name'] = processDailyParticipants[j].user_detail_full_name;
  785. data['user_id'] = processDailyParticipants[j].user_id;
  786. data['ended_at'] = processDailyParticipants[j].ended_at;
  787. data['hour_price'] = processDailyParticipants[j].hour_price;
  788. data['unit_price'] = processDailyParticipants[j].unit_price;
  789. data['dinner_duration'] = processDailyParticipants[j].dinner_duration;
  790. data['hour_count'] = processDailyParticipants[j].hour_count;
  791. data['remark'] = processDailyParticipants[j].remark;
  792. data['hour'] = processDailyParticipants[j].hour;
  793. data['diff'] = processDailyParticipants[j].diff;
  794. data['billingHour'] = processDailyParticipants[j].billingHour;
  795. data['unit_count'] = processDailyParticipants[j].unit_count;
  796. data['process_id'] = processDailies[i].process_id;
  797. data['readonly'] = "true";
  798. if (!_this.processDailies[processDailies[i].id]) {
  799. data['rowspan'] = processDailyParticipants.length;
  800. data['process_id'] = process_id;
  801. data['daily_id'] = processDailies[i].id;
  802. data['date'] = processDailies[i].date;
  803. data['output'] = processDailies[i].output;
  804. data['remain'] = processDailies[i].remain;
  805. data['submitOutput'] = processDailies[i].output;
  806. data['isAddProcessDailyParticipant'] = "true";
  807. data['isConfirmBtn'] = "true";
  808. _this.processDailies[processDailies[i].id] = processDailies[i].id;
  809. }
  810. _this.processDailyParticipants.push(data);
  811. }
  812. }
  813. },
  814. //删除工时显示
  815. closeProcessHour(e) {
  816. this.processDailies = [];
  817. this.processDailyParticipants = [];
  818. },
  819. //新增参与人
  820. addProcessDailyParticipant(processDailyParticipantOne) {
  821. let id = processDailyParticipantOne.id;
  822. if (!id) return;
  823. let _this = this;
  824. _this.errors = {};
  825. this.processDailyParticipants.every(function (processDailyParticipant, i) {
  826. if (processDailyParticipant.id == id) {
  827. processDailyParticipant.rowspan++;
  828. let data = {};
  829. data['readonly'] = "true";
  830. data['isAddProcessDailyParticipant'] = "true";
  831. data['isConfirmBtn'] = "true";
  832. data['id'] = processDailyParticipant.id;
  833. data['user_id'] = processDailyParticipant.user_id;
  834. data['status'] = processDailyParticipant.status;
  835. data['started_at'] = processDailyParticipant.started_at;
  836. data['user_detail_full_name'] = processDailyParticipant.user_detail_full_name;
  837. data['ended_at'] = processDailyParticipant.ended_at;
  838. data['hour_price'] = processDailyParticipant.hour_price;
  839. data['unit_price'] = processDailyParticipant.unit_price;
  840. data['dinner_duration'] = processDailyParticipant.dinner_duration;
  841. data['hour_count'] = processDailyParticipant.hour_count;
  842. data['remark'] = processDailyParticipant.remark;
  843. data['hour'] = processDailyParticipant.hour;
  844. data['diff'] = processDailyParticipant.diff;
  845. data['billingHour'] = processDailyParticipant.billingHour;
  846. data['unit_count'] = processDailyParticipant.unit_count;
  847. data['process_id'] = processDailyParticipant.process_id;
  848. _this.processDailyParticipants.splice(i + 1, 0, data);
  849. processDailyParticipant.id = '';
  850. processDailyParticipant.status = '';
  851. processDailyParticipant.started_at = '';
  852. processDailyParticipant.user_detail_full_name = '';
  853. processDailyParticipant.ended_at = '';
  854. processDailyParticipant.hour_price = '';
  855. processDailyParticipant.unit_price = '';
  856. processDailyParticipant.dinner_duration = '';
  857. processDailyParticipant.hour_count = '';
  858. processDailyParticipant.remark = '';
  859. processDailyParticipant.hour = '';
  860. processDailyParticipant.diff = '';
  861. processDailyParticipant.billingHour = '';
  862. processDailyParticipant.unit_count = '';
  863. processDailyParticipant.process_id = '';
  864. return false;
  865. }
  866. return true;
  867. });
  868. _this.isShow.isAddProcessDailyParticipant = false;
  869. },
  870. //取消录入参与人
  871. deleteProcessDailyParticipant($event, daily_id, processDailyParticipant_name, isConfirmBtn) {
  872. if (!isConfirmBtn) {
  873. this.processDailyParticipants.every(function (processDailyParticipant) {
  874. if (processDailyParticipant.daily_id == daily_id) {
  875. processDailyParticipant.isConfirmBtn = true; //放出隐藏确定按钮
  876. return false;
  877. }
  878. return true;
  879. });
  880. }
  881. let _this = this;
  882. this.processDailyParticipants.every(function (processDailyParticipant, i) {
  883. if (processDailyParticipant.daily_id == daily_id) {
  884. if (!processDailyParticipant_name && _this.processDailyParticipants[i + 1] && _this.processDailyParticipants[i + 1].daily_id) return false;
  885. if (!_this.processDailyParticipants[i + 1]) return false;
  886. _this.processDailyParticipants[i + 1].rowspan = (processDailyParticipant.rowspan) - 1;
  887. _this.processDailyParticipants[i + 1].daily_id = processDailyParticipant.daily_id;
  888. _this.processDailyParticipants[i + 1].date = processDailyParticipant.date;
  889. _this.processDailyParticipants[i + 1].output = processDailyParticipant.output;
  890. _this.processDailyParticipants[i + 1].remain = processDailyParticipant.remain;
  891. _this.processDailyParticipants[i + 1].submitOutput = processDailyParticipant.submitOutput;
  892. _this.processDailyParticipants.splice(i, 1);
  893. return false;
  894. }
  895. return true;
  896. });
  897. _this.isShow.isAddProcessDailyParticipant = true;
  898. },
  899. //驳回
  900. processReject(id) {
  901. if (!confirm('确定驳回该单吗?')) {
  902. return
  903. }
  904. ;
  905. let url = "{{url('process/reject')}}" + "/" + id;
  906. let _this = this;
  907. axios.post(url)
  908. .then(function (response) {
  909. _this.processes.every(function (process) {
  910. if (process.id == response.data.id) {
  911. process.status = response.data.status;
  912. return false;
  913. }
  914. return true;
  915. });
  916. tempTip.setDuration(3000);
  917. tempTip.showSuccess('驳回成功!');
  918. }).catch(function (err) {
  919. tempTip.setDuration(5000);
  920. tempTip.show('驳回二次加工单发生了一些严重错误:' + err);
  921. })
  922. },
  923. //接单
  924. processReceive(id) {
  925. let url = "{{url('process/receive')}}" + "/" + id;
  926. let _this = this;
  927. axios.post(url)
  928. .then(function (response) {
  929. _this.processes.every(function (process) {
  930. if (process.id == response.data.id) {
  931. process.status = response.data.status;
  932. return false;
  933. }
  934. return true;
  935. });
  936. tempTip.setDuration(3000);
  937. tempTip.showSuccess('接单成功!');
  938. }).catch(function (err) {
  939. tempTip.setDuration(5000);
  940. tempTip.show('接单时发生了一些严重错误:' + err);
  941. })
  942. },
  943. //完成
  944. processAccomplish(process) {
  945. if (!confirm('确定标记为加工完成吗?')) {
  946. return
  947. }
  948. ;
  949. axios.post('{{url('process/processAccomplish')}}', {id: process.id})
  950. .then(function (response) {
  951. if (response.data.success) {
  952. process.status = response.data.data;
  953. tempTip.setDuration(2000);
  954. tempTip.showSuccess('“' + process.code + '”已被标记为加工完成!');
  955. return;
  956. }
  957. tempTip.setDuration(3000);
  958. tempTip.show('未知错误,联系管理员解决!');
  959. }).catch(function (err) {
  960. tempTip.setDuration(3000);
  961. tempTip.show('网络错误:' + err);
  962. })
  963. },
  964. accomplish(process) {
  965. if (!confirm('确定“' + process.code + '”交接完成吗?')) {
  966. return
  967. }
  968. ;
  969. let url = "{{url('process/accomplish')}}";
  970. axios.post(url, {id: process.id})
  971. .then(function (response) {
  972. if (response.data.success) {
  973. process.status = response.data.data;
  974. tempTip.setDuration(2000);
  975. tempTip.showSuccess('交接完成!');
  976. return;
  977. }
  978. tempTip.setDuration(3000);
  979. tempTip.show(response.data.data);
  980. }).catch(function (err) {
  981. tempTip.setDuration(3000);
  982. tempTip.show('网络错误:' + err);
  983. })
  984. },
  985. //定位客户
  986. owner_seek: function (e) {
  987. let _this = this;
  988. let $val = e.target.value;
  989. if ($val === '') _this.filterData.owner_id = '';
  990. else
  991. _this.owners.forEach(function (owner) {
  992. if (owner.name.includes($val)) {
  993. _this.filterData.owner_id = owner.id;
  994. }
  995. });
  996. },
  997. //修改每日产量
  998. submitOutputData(daily_id, data, id) {
  999. let url = "{{url('process/updateDailyOutput')}}";
  1000. let _this = this;
  1001. axios.post(url, {id: daily_id, output: data})
  1002. .then(function (response) {
  1003. if (response.data.status == "error") {
  1004. tempTip.setDuration(3000);
  1005. tempTip.show('输入有误:' + response.data.data.output);
  1006. }
  1007. if (response.data.status == "success") {
  1008. let processDailies = response.data.data;
  1009. _this.processDailyParticipants.every(function (processDailyParticipant) {
  1010. if (processDailyParticipant.id == id) {
  1011. processDailyParticipant.readonly = true;
  1012. }
  1013. processDailies.every(function (processDaily) {
  1014. if (processDailyParticipant.date == processDaily.date) {
  1015. processDailyParticipant.output = processDaily.output;
  1016. processDailyParticipant.remain = processDaily.remain;
  1017. return false;
  1018. }
  1019. return true;
  1020. });
  1021. return true;
  1022. });
  1023. if (response.data.process) {
  1024. _this.processes.every(function (process) {
  1025. if (process.id == response.data.process) {
  1026. process.status = "待验收";
  1027. return false;
  1028. }
  1029. return true;
  1030. });
  1031. }
  1032. tempTip.setDuration(3000);
  1033. tempTip.showSuccess('每日产量修改成功!');
  1034. }
  1035. }).catch(function (err) {
  1036. tempTip.setDuration(5000);
  1037. tempTip.show('修改每日产量发生了一些严重错误:' + err);
  1038. });
  1039. },
  1040. //验证临时工
  1041. verifyUserName(e, daily_id, isConfirmBtn,processDailyParticipant) {
  1042. let user = e.target.value;
  1043. let _this = this;
  1044. axios.post('{{url('process/verifyUserName')}}',
  1045. {userName: user,id:processDailyParticipant.id,date:processDailyParticipant.date})
  1046. .then(function (response) {
  1047. if (!response.data.success){
  1048. tempTip.setDuration(3000);
  1049. tempTip.show(response.data.data);
  1050. return;
  1051. }
  1052. //修改时验证
  1053. if (!daily_id) {
  1054. //验证失败
  1055. if (response.data.data.length < 1) {
  1056. _this.isShow.isUpdateConfirmBtn = false;
  1057. _this.errors['user_id'] = "查无此人,请检查您的输入";
  1058. return;
  1059. }
  1060. //验证成功且结果仅有一个
  1061. if (response.data.data.user_id) {
  1062. _this.isShow.isUpdateConfirmBtn = true;
  1063. _this.errors['user_id'] = "";
  1064. _this.processDailyParticipantOne.user_id = response.data.data.user_id;
  1065. _this.processDailyParticipantOne.started_at = response.data.data.started_at;
  1066. _this.processDailyParticipantOne.ended_at = response.data.data.ended_at;
  1067. _this.hourFilter(_this.processDailyParticipantOne,false);
  1068. return;
  1069. }
  1070. //验证成功多结果
  1071. if (response.data.data.length > 1) {
  1072. _this.userLabors = response.data.data;
  1073. $("#myModal").modal('show');
  1074. return;
  1075. }
  1076. }
  1077. //验证失败
  1078. if (response.data.data.length < 1) {
  1079. _this.processDailyParticipants.every(function (processDailyParticipant) {
  1080. if (processDailyParticipant.daily_id == daily_id) {
  1081. _this.errors['user_id'] = "查无此人,请检查您的输入";
  1082. setTimeout(function () {
  1083. $(".tooltipTargetError").tooltip('show');
  1084. }, 1);
  1085. processDailyParticipant.isConfirmBtn = false; //验证失败隐藏确定按钮
  1086. return false;
  1087. }
  1088. return true;
  1089. });
  1090. return;
  1091. }
  1092. //按钮被隐藏则放出
  1093. if (!isConfirmBtn) {
  1094. _this.processDailyParticipants.every(function (processDailyParticipant) {
  1095. if (processDailyParticipant.daily_id == daily_id) {
  1096. processDailyParticipant.isConfirmBtn = true; //验证失败隐藏确定按钮
  1097. return false;
  1098. }
  1099. return true;
  1100. });
  1101. }
  1102. _this.modalDaily_id = daily_id;
  1103. //验证成功且结果仅有一个
  1104. if (response.data.data.user_id) {
  1105. _this.errors['user_id'] = "";
  1106. $("#" + daily_id + "user_id").val(response.data.data.user_id);
  1107. $("#" + daily_id + "hour_price").val(response.data.data.user_labor.default_hour_price);
  1108. if (response.data.data.started_at) $("#" + daily_id + "started_at").val(response.data.data.started_at);
  1109. if (response.data.data.ended_at) $("#" + daily_id + "ended_at").val(response.data.data.ended_at);
  1110. _this.hourFilter(daily_id,true);
  1111. }
  1112. //验证成功多结果
  1113. if (response.data.length > 1) {
  1114. _this.userLabors = response.data.data;
  1115. $("#myModal").modal('show');
  1116. }
  1117. }).catch(function (err) {
  1118. tempTip.setDuration(5000);
  1119. tempTip.show('验证临时工发生了一些严重错误:' + err);
  1120. })
  1121. },
  1122. //验证时间合法性
  1123. hourFilter(processDailyParticipant, is_create) {
  1124. let start = new Date('2020/1/1 12:00:00').getTime();
  1125. let end = new Date('2020/1/1 13:00:00').getTime();
  1126. if (is_create) {
  1127. let started_at = new Date('2020/1/1 ' + $('#' + processDailyParticipant + 'started_at')[0].value).getTime();
  1128. let ended_at = new Date('2020/1/1 ' + $('#' + processDailyParticipant + 'ended_at')[0].value).getTime();
  1129. let hour_count = (ended_at - started_at) / 3600000;
  1130. if (started_at < start && ended_at > end) hour_count -= 1;
  1131. let dinner_duration=Number($('#' + processDailyParticipant + 'dinner_duration')[0].value)/60;
  1132. $('#' + processDailyParticipant + 'hour_count')[0].value = (hour_count - dinner_duration).toFixed(1);
  1133. return;
  1134. }
  1135. let started_at = new Date('2020/1/1 ' + processDailyParticipant.started_at).getTime();
  1136. let ended_at = new Date('2020/1/1 ' + processDailyParticipant.ended_at).getTime();
  1137. let hour_count = (ended_at - started_at) / 3600000;
  1138. if (started_at < start && ended_at > end) hour_count -= 1;
  1139. let dinner_duration=Number(processDailyParticipant.dinner_duration) / 60;
  1140. processDailyParticipant.hour_count = (hour_count - dinner_duration).toFixed(1);
  1141. },
  1142. //提交参与人
  1143. submitProcessDailyParticipant(e) {
  1144. let request = {};
  1145. request['user_id'] = $("#" + e + "user_id").val();
  1146. request['started_at'] = $("#" + e + "started_at").val();
  1147. request['ended_at'] = $("#" + e + "ended_at").val();
  1148. let hour_price = $("#" + e + "hour_price").val();
  1149. if (hour_price) request['hour_price'] = hour_price;
  1150. let unit_price = $("#" + e + "unit_price").val();
  1151. if (unit_price) request['unit_price'] = unit_price;
  1152. let dinner_duration = $("#" + e + "dinner_duration").val();
  1153. if (dinner_duration) request['dinner_duration'] = dinner_duration;
  1154. let hour_count = $("#" + e + "hour_count").val();
  1155. if (hour_count) request['hour_count'] = hour_count;
  1156. let unit_count = $("#" + e + "unit_count").val();
  1157. if (unit_count) request['unit_count'] = unit_count;
  1158. let remark = $("#" + e + "remark").val();
  1159. if (remark) request['remark'] = remark;
  1160. request['daily_id'] = this.modalDaily_id;
  1161. let _this = this;
  1162. axios.post("{{url('process/storeProcessDailyParticipant')}}", request)
  1163. .then(function (response) {
  1164. if (response.data.status === 'warning'){
  1165. tempTip.setDuration(3000);
  1166. tempTip.show(response.data.data);
  1167. return;
  1168. }
  1169. if (response.data.status === "error") {
  1170. _this.errors = response.data.data;
  1171. setTimeout(function () {
  1172. $(".tooltipTargetError").tooltip('show');
  1173. }, 1);
  1174. setTimeout(function () {
  1175. $(".tooltipTargetError").tooltip('hide');
  1176. }, 3000);
  1177. return;
  1178. }
  1179. if (response.data.status == "success") {
  1180. _this.processDailyParticipants.every(function (processDailyParticipant) {
  1181. if (processDailyParticipant.daily_id == e) {
  1182. processDailyParticipant.id = response.data.data.id;
  1183. processDailyParticipant.status = response.data.data.status;
  1184. processDailyParticipant.user_detail_full_name = response.data.data.user_detail_full_name;
  1185. processDailyParticipant.user_id = response.data.data.user_id;
  1186. processDailyParticipant.started_at = response.data.data.started_at;
  1187. processDailyParticipant.ended_at = response.data.data.ended_at;
  1188. processDailyParticipant.hour_price = response.data.data.hour_price;
  1189. processDailyParticipant.unit_price = response.data.data.unit_price;
  1190. processDailyParticipant.dinner_duration = response.data.data.dinner_duration;
  1191. processDailyParticipant.hour_count = response.data.data.hour_count;
  1192. processDailyParticipant.unit_count = response.data.data.unit_count;
  1193. processDailyParticipant.remark = response.data.data.remark;
  1194. processDailyParticipant.hour = response.data.data.hour;
  1195. processDailyParticipant.diff = response.data.data.diff;
  1196. processDailyParticipant.billingHour = response.data.data.billingHour;
  1197. processDailyParticipant.isAddProcessDailyParticipant = true;
  1198. _this.isShow.isAddProcessDailyParticipant = true;
  1199. return false;
  1200. }
  1201. return true;
  1202. });
  1203. if (response.data.process) {
  1204. _this.processes.every(function (process) {
  1205. if (process.id == response.data.process) {
  1206. process.status = "加工中";
  1207. return false;
  1208. }
  1209. return true;
  1210. });
  1211. }
  1212. tempTip.setDuration(3000);
  1213. tempTip.showSuccess('参与人新增成功!');
  1214. }
  1215. }).catch(function (err) {
  1216. tempTip.setDuration(5000);
  1217. tempTip.show('新增参与人发生了一些严重错误:' + err);
  1218. })
  1219. },
  1220. //同名临时工选择
  1221. selectedUser(userLabor) { // TODO:此处如返回开始与结束时间 计时工时并不会发生改变
  1222. $("#myModal").modal('hide');
  1223. this.errors['user_id'] = "";
  1224. this.processDailyParticipantOne['user_id'] = userLabor.user_id;
  1225. this.processDailyParticipantOne['hour_price'] = userLabor.userLabor.default_hour_price;
  1226. this.processDailyParticipantOne['started_at'] = userLabor.started_at;
  1227. this.processDailyParticipantOne['ended_at'] = userLabor.ended_at;
  1228. this.isShow.isUpdateConfirmBtn = true;
  1229. $("#" + this.modalDaily_id + "user_id").val(userLabor.user_id);
  1230. $("#" + this.modalDaily_id + "hour_price").val(userLabor.userLabor.default_hour_price);
  1231. $("#" + this.modalDaily_id + "started_at").val(userLabor.started_at);
  1232. $("#" + this.modalDaily_id + "ended_at").val(userLabor.ended_at);
  1233. },
  1234. //修改参与人
  1235. updateProcessDailyParticipant(processDailyParticipant) {
  1236. this.errors = {};
  1237. this.processDailyParticipantOne['id'] = processDailyParticipant.id;
  1238. this.processDailyParticipantOne['user_detail_full_name'] = processDailyParticipant.user_detail_full_name;
  1239. this.processDailyParticipantOne['user_id'] = processDailyParticipant.user_id;
  1240. this.processDailyParticipantOne['started_at'] = processDailyParticipant.started_at;
  1241. this.processDailyParticipantOne['ended_at'] = processDailyParticipant.ended_at;
  1242. this.processDailyParticipantOne['hour_price'] = processDailyParticipant.hour_price;
  1243. this.processDailyParticipantOne['unit_price'] = processDailyParticipant.unit_price;
  1244. this.processDailyParticipantOne['dinner_duration'] = processDailyParticipant.dinner_duration;
  1245. this.processDailyParticipantOne['hour_count'] = processDailyParticipant.hour_count;
  1246. this.processDailyParticipantOne['unit_count'] = processDailyParticipant.unit_count;
  1247. this.processDailyParticipantOne['remark'] = processDailyParticipant.remark;
  1248. $("#updateModal").modal('show');
  1249. },
  1250. //提交修改
  1251. submitUpdateProcessDailyParticipant() {
  1252. let _this = this;
  1253. axios.post("{{url('process/updateProcessDailyParticipant')}}", this.processDailyParticipantOne)
  1254. .then(function (response) {
  1255. if (response.data.status == "error") {
  1256. tempTip.setDuration(3000);
  1257. _this.errors = response.data.data;
  1258. }
  1259. if (response.data.status == "success") {
  1260. _this.processDailyParticipants.every(function (processDailyParticipant) {
  1261. if (processDailyParticipant.id == response.data.data.id) {
  1262. processDailyParticipant.status = response.data.data.status;
  1263. processDailyParticipant.user_detail_full_name = response.data.data.user_detail_full_name;
  1264. processDailyParticipant.started_at = response.data.data.started_at;
  1265. processDailyParticipant.ended_at = response.data.data.ended_at;
  1266. processDailyParticipant.hour_price = response.data.data.hour_price;
  1267. processDailyParticipant.unit_price = response.data.data.unit_price;
  1268. processDailyParticipant.dinner_duration = response.data.data.dinner_duration;
  1269. processDailyParticipant.hour_count = response.data.data.hour_count;
  1270. processDailyParticipant.unit_count = response.data.data.unit_count;
  1271. processDailyParticipant.remark = response.data.data.remark;
  1272. processDailyParticipant.hour = response.data.data.hour;
  1273. processDailyParticipant.diff = response.data.data.diff;
  1274. processDailyParticipant.billingHour = response.data.data.billingHour;
  1275. processDailyParticipant.isAddProcessDailyParticipant = true;
  1276. return false;
  1277. }
  1278. return true;
  1279. });
  1280. tempTip.setDuration(3000);
  1281. tempTip.showSuccess('参与人修改成功!');
  1282. $("#updateModal").modal('hide');
  1283. }
  1284. }).catch(function (err) {
  1285. tempTip.setDuration(5000);
  1286. tempTip.show('修改参与人发生了一些严重错误:' + err);
  1287. })
  1288. },
  1289. {{--//登记工时参与人审核
  1290. processDailyParticipantAudit(id) {
  1291. if (!confirm('审核后不能撤销及修改,确定通过审核吗?')) {
  1292. return
  1293. }
  1294. ;
  1295. let _this = this;
  1296. axios.post("{{url('process/processDailyParticipantAudit')}}" + "/" + id)
  1297. .then(function (response) {
  1298. if (response.data.success) {
  1299. _this.processDailyParticipants.every(function (processDailyParticipant) {
  1300. if (processDailyParticipant.id == response.data.processDailyParticipant.id) {
  1301. processDailyParticipant.status = response.data.processDailyParticipant.status;
  1302. return false;
  1303. }
  1304. return true;
  1305. });
  1306. tempTip.setDuration(3000);
  1307. tempTip.showSuccess('参与人审核通过!');
  1308. return;
  1309. }
  1310. tempTip.setDuration(3000);
  1311. tempTip.show('参与人失败!');
  1312. }).catch(function (err) {
  1313. tempTip.setDuration(5000);
  1314. tempTip.show('审核参与人发生了一些严重错误:' + err);
  1315. });
  1316. },--}}
  1317. //临时工详情
  1318. showUserDetail(id) {
  1319. window.open("{{url('maintenance/userLabor')}}/" + id);
  1320. },
  1321. //显示教程
  1322. showTutorial(id) {
  1323. axios.post('{{url('maintenance/tutorial/showContent')}}' + "/" + id)
  1324. .then(function (response) {
  1325. if (response.data.success) {
  1326. $("#content").html(response.data.data);
  1327. $("#showTutorial").modal('show');
  1328. }
  1329. }).catch(function (err) {
  1330. tempTip.setDuration(3000);
  1331. tempTip.show('获取教程失败!' + '网络错误:' + err);
  1332. });
  1333. },
  1334. //新增教程
  1335. addTutorials(id, owner_id) {
  1336. let _this = this;
  1337. axios.post('{{url('process/getTutorials')}}' + "/" + id)
  1338. .then(function (response) {
  1339. if (response.data.success) {
  1340. _this.processTutorial.id = id;
  1341. _this.processTutorial.owner_id = owner_id;
  1342. _this.processTutorial.tutorials = response.data.data;
  1343. $("#addTutorial").modal("show");
  1344. return;
  1345. }
  1346. tempTip.setDuration(3000);
  1347. tempTip.show('获取教程失败!未知错误:' + response.data);
  1348. }).catch(function (err) {
  1349. tempTip.setDuration(3000);
  1350. tempTip.show('获取教程失败!' + '网络错误:' + err);
  1351. });
  1352. },
  1353. //选择教程
  1354. selectedTutorial(process_id, tutorial_id) {
  1355. let _this = this;
  1356. axios.post('{{url('process/selectedTutorial')}}', {
  1357. process_id: process_id,
  1358. tutorial_id:tutorial_id
  1359. })
  1360. .then(function (response) {
  1361. if (response.data.success) {
  1362. _this.processes.every(function (process) {
  1363. if (process.id == process_id) {
  1364. process.tutorials.push(response.data.data);
  1365. return false;
  1366. }
  1367. return true;
  1368. });
  1369. $("#addTutorial").modal("hide");
  1370. tempTip.setDuration(3000);
  1371. tempTip.showSuccess('添加成功!');
  1372. return;
  1373. }
  1374. tempTip.setDuration(3000);
  1375. tempTip.show('添加教程失败!发生错误:' + response.data.data);
  1376. }).catch(function (err) {
  1377. tempTip.setDuration(3000);
  1378. tempTip.show('添加教程失败!' + '网络错误:' + err);
  1379. });
  1380. },
  1381. //删除教程
  1382. deleteTutorials(process_id, tutorial_id) {
  1383. let _this = this;
  1384. axios.post('{{url('process/deleteTutorial')}}', {process_id: process_id, tutorial_id, tutorial_id})
  1385. .then(function (response) {
  1386. if (response.data.success) {
  1387. _this.processes.every(function (process) {
  1388. if (process.id == process_id) {
  1389. process.tutorials.every(function (tutorial, i) {
  1390. if (tutorial.id == tutorial_id) {
  1391. process.tutorials.splice(i, 1)
  1392. return false;
  1393. }
  1394. return true;
  1395. });
  1396. return false;
  1397. }
  1398. return true;
  1399. });
  1400. tempTip.setDuration(3000);
  1401. tempTip.showSuccess('删除成功!');
  1402. return;
  1403. }
  1404. tempTip.setDuration(3000);
  1405. tempTip.show('删除教程失败!发生错误:' + response.data.data);
  1406. }).catch(function (err) {
  1407. tempTip.setDuration(3000);
  1408. tempTip.show('删除教程失败!' + '网络错误:' + err);
  1409. });
  1410. },
  1411. processEdit(id) {
  1412. location.href = "{{url('process')}}/" + id + "/edit";
  1413. },
  1414. //去往新增教程
  1415. addTutorial() {
  1416. window.open("{{url('maintenance/tutorial/create?owner_id=')}}" + this.processTutorial.owner_id);
  1417. },
  1418. //展开内容单
  1419. unfold(code, id, type) {
  1420. this.$set(this.processUnfold, code + id, type);
  1421. },
  1422. close(code, id) {
  1423. this.$delete(this.processUnfold, code + id);
  1424. },
  1425. rollback(id) {
  1426. if (!confirm('确定要回滚至上一阶段吗?')) return;
  1427. if (!id) return;
  1428. let _this = this;
  1429. axios.post('{{url('process/rollback')}}', {id: id})
  1430. .then(function (response) {
  1431. if (response.data.success) {
  1432. _this.processes.every(function (process) {
  1433. if (process.id === id) {
  1434. process.status = response.data.data;
  1435. return false
  1436. }
  1437. return true;
  1438. });
  1439. tempTip.setDuration(2000);
  1440. tempTip.showSuccess('回滚成功!');
  1441. return;
  1442. }
  1443. tempTip.setDuration(3000);
  1444. tempTip.show('回滚失败!未知错误!');
  1445. }).catch(function (err) {
  1446. tempTip.setDuration(3000);
  1447. tempTip.show('回滚失败!网络错误:' + err);
  1448. })
  1449. },
  1450. //vue绑定的name type:移入移出类型
  1451. changeStyle(name, type) {
  1452. let domList = document.getElementsByName(name);
  1453. let color = '';
  1454. if (type) color = 'rgba(0, 0, 0, 0.15)';
  1455. for (let i = 0; i < domList.length; i++) {
  1456. domList[i].style.backgroundColor = color;
  1457. }
  1458. },
  1459. destroy(code, id) {
  1460. if (!confirm('确定要删除“' + code + "”吗?")) return;
  1461. let _this = this;
  1462. let delArr = [];
  1463. axios.delete('{{url('process')}}/' + id)
  1464. .then(function (response) {
  1465. tempTip.setDuration(3000);
  1466. if (response.data.success) {
  1467. _this.processes.forEach(function (process, i) {
  1468. if (process.code === code)
  1469. delArr.unshift(i);
  1470. });
  1471. delArr.forEach(function (del) {
  1472. _this.$delete(_this.processes, del);
  1473. });
  1474. tempTip.showSuccess('删除“' + code + '”成功!');
  1475. return;
  1476. }
  1477. tempTip.show('删除“' + code + '”失败!该单已不存在')
  1478. }).catch(function (err) {
  1479. tempTip.setDuration(4000);
  1480. tempTip.show("网络错误:" + err);
  1481. })
  1482. },
  1483. //审核
  1484. audit(process) {
  1485. if (!confirm('确定要通过“' + process.code + "”的审核吗?")) return;
  1486. axios.post('{{url('process/audit')}}', {id: process.id})
  1487. .then(function (response) {
  1488. if (response.data.success) {
  1489. process.status = '待接单';
  1490. tempTip.setDuration(2000);
  1491. tempTip.showSuccess('“' + process.code + "”的审核通过!");
  1492. return;
  1493. }
  1494. tempTip.setDuration(3000);
  1495. tempTip.show('审核失败:未知错误,请联系管理员!');
  1496. }).catch(function (err) {
  1497. tempTip.setDuration(3000);
  1498. tempTip.showSuccess('审核失败,网络错误:' + err);
  1499. })
  1500. },
  1501. checkAndAccept(process) {
  1502. if (!confirm('确定要验收“' + process.code + "”吗?")) return;
  1503. axios.post('{{url('process/checkAndAccept')}}', {id: process.id})
  1504. .then(function (response) {
  1505. if (response.data.success) {
  1506. process.status = response.data.data;
  1507. tempTip.setDuration(2000);
  1508. tempTip.showSuccess('“' + process.code + "”验收完成!");
  1509. return;
  1510. }
  1511. tempTip.setDuration(3000);
  1512. tempTip.show('未知错误,请联系管理员!')
  1513. }).catch(function (err) {
  1514. tempTip.setDuration(3000);
  1515. tempTip.show('网络错误:' + err)
  1516. })
  1517. },
  1518. show(id) {
  1519. window.location.href = '{{url('process')}}/' + id;
  1520. },
  1521. //修改价格
  1522. updateUnitPrice(process) {
  1523. if (!confirm('确定要修改“' + process.code + "”的单价吗?")) return;
  1524. let unit_price = $('#unit_price_' + process.id)[0].value;
  1525. if (!unit_price || isNaN(unit_price)) {
  1526. tempTip.setDuration(3000);
  1527. tempTip.show('请输入正确的价格!');
  1528. return;
  1529. }
  1530. axios.post('{{url('process/updateUnitPrice')}}', {id: process.id, unit_price: unit_price})
  1531. .then(function (response) {
  1532. if (response.data.success) {
  1533. process.signs.push(response.data.sign);
  1534. process.is_update_unit_price = false;
  1535. tempTip.setDuration(2000);
  1536. tempTip.showSuccess('“' + process.code + "”价格修改成功,确认通过后生效!");
  1537. return;
  1538. }
  1539. tempTip.setDuration(3000);
  1540. tempTip.show(response.data.data);
  1541. }).catch(function (err) {
  1542. tempTip.setDuration(3000);
  1543. tempTip.show('网络错误:' + err);
  1544. })
  1545. },
  1546. //组长或财务确认
  1547. verify(process, type) {
  1548. if (!confirm('确定要通过“'+process.code+"”的审核吗"))return;
  1549. let url = '{{url('process/workGroupVerify')}}';
  1550. let msg = '二次加工组';
  1551. if (type === 'accountant') {
  1552. url = '{{url('process/accountantVerify')}}';
  1553. msg = '财务';
  1554. }
  1555. let _this=this;
  1556. axios.post(url, {id: process.id})
  1557. .then(function (response) {
  1558. if (response.data.success) {
  1559. if (response.data.data){
  1560. process.signs.push(response.data.data);
  1561. _this.$set(_this.signs[process.code],response.data.data.mark,true);
  1562. }else{
  1563. _this.signs[process.code]=[];
  1564. process.signs=[];
  1565. }
  1566. tempTip.setDuration(2000);
  1567. tempTip.showSuccess('“' + process.code + "”新价格通过" + msg + "审核!");
  1568. return;
  1569. }
  1570. tempTip.setDuration(3000);
  1571. tempTip.show(response.data.data);
  1572. }).catch(function (err) {
  1573. tempTip.setDuration(3000);
  1574. tempTip.show('网络错误:' + err);
  1575. })
  1576. },
  1577. is_checked(e){
  1578. if (e.target.checked) this.filterData.is_accomplish=e.target.checked;
  1579. else this.filterData.is_accomplish='';
  1580. setTimeout( res=>{
  1581. this.submit();
  1582. },1);
  1583. },
  1584. update_process_date(processDailyParticipant){
  1585. let date=this.date;
  1586. let is_update_date=this.is_update_date;
  1587. let _this=this;
  1588. if (is_update_date==='start_date') _this.dateTextMap.start_date='起';
  1589. else _this.dateTextMap.end_date='终';
  1590. if (!date){
  1591. tempTip.show('未输入日期!');
  1592. return;
  1593. }
  1594. let url='';
  1595. if (is_update_date==='start_date'){
  1596. if (!confirm('确定要设定“'+date+'”为新的起始日期吗?以往记录将被删除!'))return;
  1597. url='{{url('process/updateStartDate')}}';
  1598. }
  1599. else{
  1600. if (!confirm('确定要设定“'+date+'”为新的终止日期吗?'))return;
  1601. url='{{url('process/updateEndDate')}}';
  1602. }
  1603. axios.post(url,{process_id:processDailyParticipant.process_id,date:date})
  1604. .then(function (response) {
  1605. if(response.data.success){
  1606. _this.resetProcessDaily(response.data.data,processDailyParticipant.process_id);
  1607. _this.is_update_date='';
  1608. tempTip.setDuration(2000);
  1609. tempTip.showSuccess('成功修改“'+date+'”为新的'+(is_update_date==='start_date' ? '起始时间' :'终止时间')+'!');
  1610. return;
  1611. }
  1612. tempTip.setDuration(3000);
  1613. tempTip.show(response.data.data);
  1614. }).catch(function (err) {
  1615. tempTip.setDuration(3000);
  1616. tempTip.show('网络错误:'+err);
  1617. })
  1618. },
  1619. resetProcessDailyParticipants(index){
  1620. if (this.processDailyParticipants[index].daily_id){
  1621. if (this.processDailyParticipants[index+1] && !this.processDailyParticipants[index+1].daily_id){
  1622. this.processDailyParticipants[index+1].daily_id=this.processDailyParticipants[index].daily_id;
  1623. this.processDailyParticipants[index+1].date=this.processDailyParticipants[index].date;
  1624. this.processDailyParticipants[index+1].isAddProcessDailyParticipant=this.processDailyParticipants[index].isAddProcessDailyParticipant;
  1625. this.processDailyParticipants[index+1].isConfirmBtn=this.processDailyParticipants[index].isConfirmBtn;
  1626. this.processDailyParticipants[index+1].output=this.processDailyParticipants[index].output;
  1627. this.processDailyParticipants[index+1].process_id=this.processDailyParticipants[index].process_id;
  1628. this.processDailyParticipants[index+1].readonly=this.processDailyParticipants[index].readonly;
  1629. this.processDailyParticipants[index+1].remain=this.processDailyParticipants[index].remain;
  1630. this.processDailyParticipants[index+1].rowspan=this.processDailyParticipants[index].rowspan - 1;
  1631. this.processDailyParticipants[index+1].submitOutput=this.processDailyParticipants[index].submitOutput;
  1632. this.$delete(this.processDailyParticipants,index);
  1633. }else{
  1634. let processDailyParticipant = {
  1635. 'daily_id': this.processDailyParticipants[index].daily_id,
  1636. 'date': this.processDailyParticipants[index].date,
  1637. 'isAddProcessDailyParticipant': this.processDailyParticipants[index].isAddProcessDailyParticipant,
  1638. 'isConfirmBtn': this.processDailyParticipants[index].isConfirmBtn,
  1639. 'output': this.processDailyParticipants[index].output,
  1640. 'process_id': this.processDailyParticipants[index].process_id,
  1641. 'readonly': this.processDailyParticipants[index].readonly,
  1642. 'remain': this.processDailyParticipants[index].remain,
  1643. 'rowspan': this.processDailyParticipants[index].rowspan,
  1644. 'submitOutput': this.processDailyParticipants[index].submitOutput,
  1645. };
  1646. this.$set(this.processDailyParticipants,index,processDailyParticipant);
  1647. }
  1648. }
  1649. else this.$delete(this.processDailyParticipants,index);
  1650. },
  1651. deleteDailyParticipant(index){
  1652. let _this=this;
  1653. if (!confirm('确定要删除“' + _this.processDailyParticipants[index].user_detail_full_name + "”的工作记录吗?"))return;
  1654. axios.delete('{{url('process/destroyDailyParticipant')}}/'+_this.processDailyParticipants[index].id)
  1655. .then(res=>{
  1656. if (res.data.success){
  1657. _this.resetProcessDailyParticipants(index);
  1658. tempTip.setDuration(2000);
  1659. tempTip.showSuccess('删除“'+_this.processDailyParticipants[index].user_detail_full_name+'”的工作记录成功!');
  1660. return;
  1661. }
  1662. tempTip.setDuration(3000);
  1663. tempTip.show(res.data.data);
  1664. }).catch(err=>{
  1665. tempTip.setDuration(4000);
  1666. tempTip.show('网络错误:'+err);
  1667. })
  1668. },
  1669. //修改时的晚饭时间改变计时工时
  1670. updateDinnerDuration(processDailyParticipantOne,e){
  1671. let oldValue=Number(e.target.dataset.oldValue) / 60;
  1672. let newValue=Number(processDailyParticipantOne.dinner_duration) / 60;
  1673. processDailyParticipantOne.hour_count += (oldValue-newValue);
  1674. },
  1675. },
  1676. });
  1677. </script>
  1678. @endsection