index.blade.php 127 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207
  1. @extends('layouts.app')
  2. @section('title')查询-问题件@endsection
  3. @section('content')
  4. <div class="container-fluid" id="issue_div">
  5. <div style="@cannot('订单管理-问题件-客户不可见')min-width: 3000px;@else min-width: 1990px; @endcannot">
  6. <div id="list" class="d-none container-fluid">
  7. <div id="form_div" style="min-width: 2250px;"></div>
  8. <div class="form-inline mt-1" id="btn">
  9. <span class="dropdown">
  10. <button type="button"
  11. class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget"
  12. :class="[checkData.length>0?'btn-dark text-light':'']"
  13. data-toggle="dropdown" title="导出所有页将会以搜索条件得到的筛选结果,将其全部记录(每一页)导出">导出Excel
  14. </button>
  15. <div class="dropdown-menu">
  16. <a class="dropdown-item" @click="orderIssueExport(false)" href="javascript:">导出勾选内容</a>
  17. <a class="dropdown-item" @click="orderIssueExport(true)" href="javascript:">导出所有页</a>
  18. </div>
  19. </span>
  20. @cannot('订单管理-问题件-客户不可见')
  21. <span class="ml-1">
  22. <button type="button" class="btn btn-outline-dark btn-sm form-control-sm tooltipTarget"
  23. @click="endOrderIssue" :class="[checkData.length>0?'btn-dark text-light':'']"
  24. style="background: #dad7e8;">批量完结</button>
  25. </span>
  26. @endcannot
  27. @can('订单管理-问题件-删除')
  28. <span class="ml-1">
  29. <button type="button" class="btn btn-outline-dark btn-sm form-control-sm tooltipTarget"
  30. @click="batchDeleteOrderIssue">批量删除</button>
  31. </span>
  32. @endcan
  33. @can('订单管理-问题件-编辑')
  34. <span class="ml-1">
  35. <button type="button" class="btn btn-outline-dark btn-sm form-control-sm tooltipTarget"
  36. @click="batchStoreLogsModel" style="background: #d7e8df;">批量处理说明</button>
  37. <span class="ml-1">
  38. <button type="button" class="btn btn-outline-dark btn-sm form-control-sm tooltipTarget"
  39. @click="batchOthersModel">批量处理赔偿金额与事故责任方</button>
  40. </span>
  41. @endcan
  42. <span class="ml-1">
  43. <button type="button" class="btn btn-outline-dark btn-sm form-control-sm tooltipTarget"
  44. @click="copyOrderNo" style="background: #dad7e8;">复制快递单号</button>
  45. </span>
  46. <span class="ml-1">
  47. <button type="button" class="btn btn-outline-dark btn-sm form-control-sm tooltipTarget"
  48. @click="importdispose">批量导入处理</button>
  49. </span>
  50. <span class="ml-1">
  51. <button type="button" class="btn btn-outline-dark btn-sm form-control-sm tooltipTarget"
  52. @click="copyRejectedLogisticNumber" style="background: #dad7e8;">复制退回单号</button>
  53. </span>
  54. @cannot('订单管理-问题件-客户不可见')
  55. @can('订单管理-问题件-财务确认')
  56. <span class="ml-1">
  57. <button type="button" class="btn btn-outline-dark btn-sm form-control-sm tooltipTarget"
  58. @click="financeConfirm('是')" style="background: #d7e8df;">批量财务确认
  59. </button>
  60. </span>
  61. <span class="ml-1">
  62. <button type="button" class="btn btn-outline-dark btn-sm form-control-sm tooltipTarget"
  63. @click="financeConfirm('否')"> 批量财务确认取消
  64. </button>
  65. </span>
  66. @endcan
  67. @can('订单管理-问题件-批量归档')
  68. <span class="ml-1">
  69. <button type="button" class="btn btn-outline-primary btn-sm form-control-sm tooltipTarget"
  70. @click="archiveOrderIssue" v-show="checkData.length>0">批量归档
  71. </button>
  72. </span>
  73. @endcan
  74. @endcannot
  75. </div>
  76. <table class="table table-sm table-striped table-bordered table-hover card-body p-0 m-0"
  77. style="background: #fff;@cannot('订单管理-问题件-客户不可见')min-width: 3000px;@else min-width: 1990px; @endcannot">
  78. <tr class="tr-yellow align-center">
  79. <th class=" font-weight-bolder header-1"></th>
  80. <th class="td-yellow font-weight-bolder original-class table-head-warning header-2 text-center" colspan="8">
  81. 原始运单
  82. </th>
  83. <th class="font-weight-bolder header-3 text-center" colspan="14">
  84. 情况说明
  85. </th>
  86. @cannot('订单管理-问题件-客户不可见')
  87. <th></th>
  88. @endcannot
  89. </tr>
  90. <tr class="tr-yellow" align="center">
  91. <th rowspan="2" class="align-middle one-layer">
  92. <label for="all">
  93. <input id="all" type="checkbox" @click="checkAll($event)"/>
  94. </label>
  95. </th>
  96. <th class="one-layer align-middle" rowspan="2" style=" min-width: 50px;">序号</th>
  97. <th class="one-layer align-middle" rowspan="2" style=" min-width: 70px;">ID</th>
  98. @cannot('订单管理-问题件-客户不可见')
  99. <th class="one-layer align-middle" rowspan="2" style=" max-width: 55px;min-width: 55px">新退件状态</th>
  100. @can("订单管理-问题件-置顶")
  101. <th class="one-layer align-middle" rowspan="2" style=" min-width: 75px;">置顶</th>
  102. @endcan
  103. <th class="one-layer align-middle" rowspan="2" style=" min-width: 100px;">退单状态</th>
  104. @endcannot
  105. <th class="one-layer align-middle" rowspan="2" style="min-width: 90px">最终状态</th>
  106. @cannot('订单管理-问题件-客户不可见')
  107. <th class="tow-layer align-middle td-yellow" rowspan="2" style="max-width: 95px;min-width: 95px;">登记日期</th>
  108. @endcannot
  109. <th class="tow-layer align-middle td-yellow" rowspan="2" style="max-width: 95px;min-width: 95px;">订单日期</th>
  110. <th class="tow-layer align-middle td-yellow" rowspan="2" style="max-width: 100px;min-width: 100px;">客户</th>
  111. <th class="tow-layer align-middle td-yellow" rowspan="2" style="max-width: 120px;min-width: 120px;">店铺</th>
  112. <th class="tow-layer align-middle td-yellow" rowspan="2" style="max-width: 150px;min-width: 150px;">客户订单号</th>
  113. <th class="tow-layer align-middle td-yellow" rowspan="2" style="max-width: 100px;min-width: 100px;">原始承运商</th>
  114. <th class="tow-layer align-middle td-yellow" rowspan="2" style="max-width: 150px;min-width: 150px;">原始运单号</th>
  115. {{--原始商品明细 开始--}}
  116. <th class="tow-layer align-middle td-yellow" v-show="isShowOrderInfo" rowspan="2"
  117. style="min-width: 200px">收货人名称</th>
  118. <th class="tow-layer align-middle td-yellow" v-show="isShowOrderInfo" rowspan="2"
  119. style="min-width: 200px;">收货人电话</th>
  120. <th class="tow-layer align-middle td-yellow" v-show="isShowOrderInfo" rowspan="2"
  121. style="min-width: 70px">省</th>
  122. <th class="tow-layer align-middle td-yellow" v-show="isShowOrderInfo" rowspan="2"
  123. style="min-width: 70px">市</th>
  124. <th class="tow-layer align-middle td-yellow" v-show="isShowOrderInfo" rowspan="2"
  125. style="min-width: 70px">区</th>
  126. <th class="tow-layer align-middle td-yellow" v-show="isShowOrderInfo" rowspan="2"
  127. style="min-width:300px">收货人地址</th>
  128. <th class="tow-layer align-middle td-yellow" v-show="isShowOrderInfo" colspan="3"
  129. style="min-width:300px">原始商品明细</th>
  130. <th class="tow-layer align-middle td-yellow" rowspan="2" style="max-width:50px">@{{
  131. isShowOrderInfo? '隐藏':'展开' }}</th>
  132. {{--原始商品明细 结束--}}
  133. {{--原始商品明细 开始--}}
  134. <th class="three-layer align-middle" rowspan="2" style="max-width:50px">@{{ isShowRejectedBill
  135. ? '隐藏':'展开' }}</th>
  136. <th class="three-layer align-middle" rowspan="2" v-show="isShowRejectedBill"
  137. style="min-width:265px">退回单号</th>
  138. <th class="three-layer align-middle" colspan="5" v-show="isShowRejectedBill"
  139. style="min-width: 450px">返回商品明细</th>
  140. <th class="three-layer bg-whit align-middle" rowspan="2" style="min-width: 180px">情况说明</th>
  141. <th class="three-layer align-middle" rowspan="2" style="min-width: 115px">问题类别</th>
  142. <th class="three-layer align-middle" colspan="4" style="min-width: 155px">处理结果</th>
  143. @cannot('订单管理-问题件-客户不可见')
  144. <th class="three-layer align-middle" rowspan="2"
  145. style="width:50px">@{{ isShowSecondOrderInfo ? '隐藏':'展开' }}</th>
  146. <th class="three-layer align-middle" rowspan="2" v-show="isShowSecondOrderInfo"
  147. style=" min-width: 120px;">二次客户订单号</th>
  148. <th class="three-layer align-middle" rowspan="2" v-show="isShowSecondOrderInfo"
  149. style=" min-width: 100px;">二次承运商</th>
  150. <th class="three-layer align-middle" rowspan="2" v-show="isShowSecondOrderInfo"
  151. style=" min-width: 200px;">二次运单号</th>
  152. <th class="three-layer" colspan="3" v-show="isShowSecondOrderInfo" style=" min-width: 350px;">
  153. 二次商品明细</th>
  154. @endcannot
  155. {{--原始商品明细 结束--}}
  156. @cannot('订单管理-问题件-客户自定义订单号')
  157. <th class="three-layer align-middle" rowspan="2" style="min-width: 120px">自定义订单号</th>
  158. @endcannot
  159. @cannot('订单管理-问题件-客户不可见')
  160. <th class="three-layer align-middle" rowspan="2" style="min-width: 120px">承运商赔偿金额</th>
  161. <th class="three-layer align-middle" rowspan="2" style="min-width: 120px">承运商快递减免</th>
  162. @endcannot
  163. <th class="three-layer align-middle" rowspan="2" style="min-width: 120px">宝时赔偿金额</th>
  164. <th class="three-layer align-middle" rowspan="2" style="min-width: 120px">宝时快递减免</th>
  165. @cannot('订单管理-问题件-客户不可见')
  166. <th class="three-layer align-middle" rowspan="2" style="min-width: 200px">仓库组责任方</th>
  167. <th class="three-layer align-middle" rowspan="2" style="min-width: 200px">项目组责任方</th>
  168. <th class="align-middle" rowspan="2" style="min-width: 120px">操作</th>
  169. @endcannot
  170. </tr>
  171. <tr class="tr-yellow align-center">
  172. <th class="td-yellow" v-show="isShowOrderInfo" style="min-width: 120px">条码</th>
  173. <th class="td-yellow" v-show="isShowOrderInfo" style="min-width: 150px">商品名</th>
  174. <th class="td-yellow" v-show="isShowOrderInfo" style="min-width: 75px">数量</th>
  175. @cannot('订单管理-问题件-客户不可见')
  176. <th v-show="isShowRejectedBill" style="min-width: 75px">条码</th>
  177. <th v-show="isShowRejectedBill" style="min-width: 100px">商品名</th>
  178. <th v-show="isShowRejectedBill" style="min-width: 50px">数量</th>
  179. <th v-show="isShowRejectedBill" style="min-width: 50px">是否正品</th>
  180. <th v-show="isShowRejectedBill" style="min-width: 100px">备注</th>
  181. @endcannot
  182. <th style="max-width: 135px">说明</th>
  183. <th style="max-width: 55px">操作者</th>
  184. <th style="max-width: 135px">时间</th>
  185. <th></th>
  186. @cannot('订单管理-问题件-客户不可见')
  187. <th v-show="isShowSecondOrderInfo" style="min-width: 100px">条码</th>
  188. <th v-show="isShowSecondOrderInfo" style="min-width: 100px">商品名</th>
  189. <th v-show="isShowSecondOrderInfo" style="min-width: 75px">数量</th>
  190. @endcannot
  191. </tr>
  192. <tbody id="tbody">
  193. <tr class="tr-yellow text-center table-body" v-if="orderIssues"
  194. v-for="(orderIssue,index) in orderIssues"
  195. @click="selectedColor(orderIssue.id,$event)" :class="orderIssue.top ? 'tr_top':''"
  196. v-on:mouseover="hidetop($event)" v-on:mouseleave="showtop($event)">
  197. <td class="child-layer-1">
  198. <div class="m-0 p-0 " :style="[{'min-height':orderIssue.top ?'72px':'45px'}]">
  199. <label>
  200. <input class="checkItem" type="checkbox" :value="orderIssue.id" v-model="checkData">
  201. </label>
  202. </div>
  203. </td>
  204. <td class="child-layer-1 text-nowrap">
  205. @{{index+1}}
  206. <span class="text-muted" v-show="orderIssue.finance_confirm === '是'">财务确认</span>
  207. </td>
  208. <td class="child-layer-1">
  209. @{{ orderIssue.id }}
  210. @can('订单管理-问题件-编辑')
  211. <button v-if="orderIssue.imported_status === '导入未处理'" type="button"
  212. class="btn btn-sm btn-primary"
  213. @click="updateOrderIssue(orderIssue,'imported_status',$event)">导入</button>
  214. @endcan
  215. </td>
  216. @cannot('订单管理-问题件-客户不可见')
  217. <td class="child-layer-1">
  218. @can('订单管理-问题件-编辑')
  219. <button v-if="orderIssue.is_new_rejecting === '有'" type="button"
  220. class="btn btn-sm btn-outline-secondary"
  221. @click="disposeOrderIssue(orderIssue)">有</button>
  222. <span v-else>@{{ orderIssue.is_new_rejecting }}</span>
  223. @else
  224. <span v-if="orderIssue.is_new_rejecting">@{{ orderIssue.is_new_rejecting }}</span>
  225. @endcan
  226. <span class="badge badge-info" v-if="orderIssue.is_intercept === 1">库内拦截</span>
  227. </td>
  228. @can("订单管理-问题件-置顶")
  229. <td class="text-muted child-layer-1">
  230. <button type="button" class="btn btn-sm btn-outline-danger"
  231. @click="cancelOnTop(orderIssue.top.id)" style="opacity: 0.75"
  232. v-if="orderIssue.top">取消</button>
  233. <button type="button" class="btn btn-sm btn-outline-secondary"
  234. @click="OrderIssueOnTop(orderIssue.id)" :data-value="orderIssue.id"
  235. style="opacity: 0.75" v-else>置顶</button>
  236. </td>
  237. @endcan
  238. <td class="child-layer-1">
  239. @can('订单管理-问题件-编辑')
  240. <label>
  241. <select class="form-control form-control-sm"
  242. :value="orderIssue.rejecting_status"
  243. @change="updateOrderIssue(orderIssue,'rejecting_status',$event)">
  244. <option v-for="item in rejectingStatus" :value="item.name">@{{ item.value }}</option>
  245. </select>
  246. </label>
  247. @else
  248. @{{ orderIssue.rejecting_status }}
  249. @endcan
  250. </td>
  251. @endcannot
  252. <td class="child-layer-1">
  253. @can('订单管理-问题件-编辑')
  254. <label>
  255. <select class="form-control form-control-sm" :value="orderIssue.final_status"
  256. @change="updateOrderIssue(orderIssue,'final_status',$event)">
  257. <option v-for="item in finalStatus" :value="item.value">@{{ item.name }}</option>
  258. </select>
  259. </label>
  260. @else
  261. @{{ orderIssue.final_status }}
  262. @endcan
  263. </td>
  264. @cannot('订单管理-问题件-客户不可见')
  265. <td class="toptd td-yellow child-layer-2 m-0 p-0 pt-1">
  266. <div v-if="orderIssue.remark"
  267. class="bg-light-yellow text-danger top text-left position-absolute"
  268. data-toggle="tooltip" style="opacity: 0.1;z-index: 1">置顶备注:@{{ orderIssue.remark }}</div>
  269. @{{ orderIssue.created_at }}
  270. </td>
  271. @endcannot
  272. <td class="td-yellow child-layer-2 m-0 p-0 pt-1">
  273. @cannot('订单管理-问题件-客户不可见')
  274. @else
  275. <div v-if="orderIssue.top" class="bg-light-yellow text-danger top text-left"
  276. data-toggle="tooltip" style="opacity: 0.1;position: absolute;z-index: 1">置顶备注:@{{ orderIssue.top.remark}}</div>
  277. @endcannot
  278. @{{ orderIssue.order.created_at }}
  279. </td>
  280. <td class="td-yellow child-layer-2">
  281. <span v-if='orderIssue.order.owner'>@{{ orderIssue.order.owner.name }}</span>
  282. </td>
  283. <td class="td-yellow child-layer-2">
  284. <span v-if="orderIssue.order.shop">@{{ orderIssue.order.shop.name }}</span>
  285. </td>
  286. <td class="td-yellow child-layer-2">
  287. <span v-if="orderIssue.order">@{{ orderIssue.order.client_code }}</span>
  288. </td>
  289. <td class="td-yellow child-layer-2">
  290. <span v-if='orderIssue.order.logistic'>@{{ orderIssue.order.logistic.name }}</span>
  291. </td>
  292. <td class=" hide-content p-0 td-yellow child-layer-2 align-center">
  293. <template v-if="orderIssue.order">
  294. <span :class="orderIssue.order.packages.length > 1 ?'collapse ':''"
  295. :id="'logisticNumbers'+orderIssue.id">
  296. <span class="m-0 p-0 d-inline-block" v-for="(package,key) in orderIssue.order.packages">@{{ (orderIssue.custom_code && isDB(orderIssue.order.logistic_id)) ? orderIssue.custom_code +'-'+(key+1) : (package.logistic_number!==orderIssue.order.code ? package.logistic_number:'') }}&nbsp;&nbsp;</span>
  297. </span>
  298. <button type="button" class="btn btn-sm btn-outline-primary align-middle mt-1"
  299. v-if="orderIssue.order.packages.length > 1"
  300. :id="'logisticNumbersBtn'+orderIssue.id" data-toggle="collapse"
  301. :data-target="'#logisticNumbers'+orderIssue.id"
  302. @click="toggleLogisticNumbers(orderIssue.id,orderIssue.order.packages.length)"
  303. >分箱@{{ orderIssue.order.packages.length }}件,点击展开</button>
  304. </template>
  305. </td>
  306. {{--商品明细 开始--}}
  307. <td class="td-yellow child-layer-2-hide text-wrap text-letter" v-show="isShowOrderInfo"
  308. style="max-width: 320px">@{{ orderIssue.order.consignee_name }}
  309. </td>
  310. <td class="td-yellow child-layer-2-hide text-wrap text-letter" v-show="isShowOrderInfo"
  311. style="max-width: 320px">@{{ orderIssue.order.consignee_phone }}
  312. </td>
  313. <td class="td-yellow child-layer-2-hide" v-show="isShowOrderInfo">@{{ orderIssue.order.province }}</td>
  314. <td class="td-yellow child-layer-2-hide" v-show="isShowOrderInfo">@{{ orderIssue.order.city }}</td>
  315. <td class="td-yellow child-layer-2-hide" v-show="isShowOrderInfo">@{{ orderIssue.order.district }}</td>
  316. <td class="td-yellow child-layer-2-hide" style="max-width: 400px" v-show="isShowOrderInfo">
  317. <span class="text-wrap m-0 p-0 text-wrap text-letter" style="max-width: 550px">@{{ orderIssue.order.address }}</span>
  318. </td>
  319. <td class="td-yellow p-0 child-layer-2-hide" :id="orderIssue.id+'items'" colspan="3"
  320. v-show="isShowOrderInfo">
  321. <div v-if="orderIssue.order">
  322. <table class="table table-sm m-0" v-if="orderIssue.order.packages"
  323. :class="orderIssue.order.type_numbers > 1? 'collapse' : ''"
  324. :id="'order'+orderIssue.id">
  325. <template v-for="packages in orderIssue.order.packages">
  326. <tr v-for="item in packages.commodities" class="text-center align-center"
  327. v-if="item.commodity" @click="removeFocusing($event)">
  328. <td>@{{ item.commodity.sku }}</td>
  329. <td>
  330. <p class="text-truncate text-primary m-0 p-0 tooltipTarget"
  331. style="width: 100px;cursor:pointer;text-decoration: underline"
  332. title="双击展开" @dblclick="nowrapText($event)">@{{ item.commodity.name }}</p>
  333. <p class="text-nowrap m-0 p-0 tooltipTarget"
  334. style="display: none;cursor:pointer" @dblclick="truncateText($event)"
  335. title="双击收起">@{{ item.commodity.name }}</p>
  336. </td>
  337. <td>@{{ item.amount }}</td>
  338. </tr>
  339. </template>
  340. </table>
  341. <button v-if="orderIssue.order.type_numbers > 1" type="button"
  342. class="btn btn-sm btn-outline-primary mt-1" :id="'orderBtn'+orderIssue.id"
  343. @click="toggleOrder(orderIssue.id,orderIssue.order.amounts)"
  344. data-toggle="collapse" :data-target="'#order'+orderIssue.id">
  345. 商品@{{ orderIssue.order.amounts }}件,点击展开
  346. </button>
  347. </div>
  348. </td>
  349. <td class="td-yellow p-0 m-0 child-layer-2 w-50" style="width:50px;" v-if="index===0" :rowspan="orderIssues.length">
  350. <span class="btn" :class="isShowOrderInfo ? 'btn-outline-secondary':'btn-outline-info'"
  351. @click="toggleOrderInfo" :style="{'min-height':toggleBtnHeight+'px'}">
  352. @{{ isShowOrderInfo ? '隐藏运单列' : '展开运单列'}}
  353. </span>
  354. </td>
  355. {{--商品明细 结束--}}
  356. {{--情况说明 开始--}}
  357. <td class="p-0 m-0 child-layer-3" style="width:50px;" v-if="index===0"
  358. :rowspan="orderIssues.length">
  359. <span class="btn" :class="isShowRejectedBill ? 'btn-outline-secondary':'btn-outline-info'"
  360. @click="toggleRejectedBill" :style="{'min-height':toggleBtnHeight+'px'}">
  361. @{{ isShowRejectedBill ? '隐藏退单列' : '展开退单列'}}
  362. </span>
  363. </td>
  364. <td class="text-muted child-layer-3-hide" v-show="isShowRejectedBill">
  365. @can('订单管理-问题件-编辑')
  366. <div class="form-inline">
  367. <div class="form-group">
  368. {{--添加--}}
  369. <input type="text" class="form-control form-text form-control-sm mr-1">
  370. <button class="btn btn-sm btn-primary"
  371. @click="joinRejectedBill(orderIssue,$event)">添加
  372. </button>
  373. </div>
  374. </div>
  375. <div class="form-inline"
  376. v-for="orderIssueRejectedBill in orderIssue.order_issue_rejected_bills">
  377. {{--修改--}}
  378. <input type="text" class="form-control form-control-sm mt-1 mr-1"
  379. :value="orderIssueRejectedBill.logistic_number_return"
  380. @change="reviseJoinRejectedBill(orderIssue,orderIssueRejectedBill.logistic_number_return,$event)"
  381. @focus="displayDelBtn(true,$event)" @blur="displayDelBtn(false,$event)">
  382. {{--删除--}}
  383. <button type="button" class="btn btn-sm btn-outline-danger mt-1 d-none"
  384. @click="unJoinRejectedBill(orderIssue,orderIssueRejectedBill.logistic_number_return)">
  385. </button>
  386. </div>
  387. @else
  388. <span v-for="order_issue_rejected_bill in orderIssue.order_issue_rejected_bills">
  389. <span class="d-inline-block w-100">@{{ order_issue_rejected_bill.logistic_number_return }}</span>
  390. </span>
  391. @endcan
  392. </td>
  393. <td class="p-0 child-layer-3-hide align-center" :id="orderIssue.id+'rejectedBill'" colspan="5"
  394. v-show="isShowRejectedBill">
  395. <div v-if="orderIssue.order_issue_rejected_bills" class="m-0 p-0">
  396. <table class="table table-sm m-0"
  397. :class="orderIssue.rejected_bill_type_numbers > 2 ? 'collapse' : '' "
  398. :id="'rejectedBill'+orderIssue.id">
  399. <template
  400. v-for="order_issue_rejected_bill in orderIssue.order_issue_rejected_bills">
  401. <template v-if="order_issue_rejected_bill.rejected_bill">
  402. <tr v-for="item in order_issue_rejected_bill.rejected_bill.items"
  403. @click="removeFocusing($event)" v-show="isShowRejectedBill">
  404. <td class="w-50">@{{ item.barcode_goods }}</td>
  405. <td>
  406. <div class="text-truncate text-primary tooltipTarget w-100"
  407. style="cursor:pointer;text-decoration: underline" title="双击展开"
  408. @dblclick="nowrapText($event)">@{{ item.name_goods }}
  409. </div>
  410. <div class="text-nowrap m-0 p-0 tooltipTarget"
  411. style="display: none;cursor:pointer"
  412. @dblclick="truncateText($event)" title="双击收起">@{{
  413. item.name_goods }}
  414. </div>
  415. </td>
  416. <td class="w-25">@{{ item.amount }}</td>
  417. <td class="w-25">@{{ item.quality_label }}</td>
  418. <td class="w-auto">@{{ item.remark }}</td>
  419. </tr>
  420. </template>
  421. </template>
  422. </table>
  423. <button v-if="orderIssue.rejected_bill_type_numbers > 1" type="button"
  424. class="btn btn-sm btn-outline-primary align-middle mt-1"
  425. :id="'rejectedBillBtn'+orderIssue.id"
  426. data-toggle="collapse" :data-target="'#rejectedBill'+orderIssue.id"
  427. @click="toggleRejectedBillItems(orderIssue.id,orderIssue.rejected_bill_amounts)">
  428. 商品@{{ orderIssue.rejected_bill_amounts }}件,点击展开
  429. </button>
  430. </div>
  431. </td>
  432. <td class="child-layer-3">
  433. @can('订单管理-问题件-编辑')
  434. <textarea class="form-control form-control-sm"
  435. @change="updateOrderIssue(orderIssue,'result_explain',$event)"
  436. data-toggle="tooltip" data-placement="bottom"
  437. :title="orderIssue.result_explain"
  438. :cols="orderIssue.result_explain==null?'': (orderIssue.result_explain.length>10?10:orderIssue.result_explain.length)"
  439. :rows="orderIssue.result_explain==null?2: (orderIssue.result_explain.length>10?(Math.ceil(orderIssue.result_explain.length)/10)+1:2)"
  440. >@{{ orderIssue.result_explain }}</textarea>
  441. @else
  442. @{{ orderIssue.result_explain}}
  443. @endcan
  444. </td>
  445. <td class="child-layer-3">
  446. @can('订单管理-问题件-编辑')
  447. <select class="form-control form-control-sm" :value="orderIssue.order_issue_type_id"
  448. @change="updateOrderIssue(orderIssue,'order_issue_type_id',$event)">
  449. <option value></option>
  450. <option v-for="type in orderIssueType" :value="type.name">@{{ type.value }}</option>
  451. </select>
  452. @else
  453. <span v-if="orderIssue.issue_type">@{{ orderIssue.issue_type.name}}</span>
  454. @endcan
  455. </td>
  456. <td class=" m-0 p-0 log-td child-layer-3 align-center" v-on:mouseover="showAddBtn($event)"
  457. v-on:mouseleave="hideAddBtn($event)" colspan="4">
  458. @can('订单管理-问题件-处理结果添加')
  459. <div style="position: absolute;display: none;margin-top: -35px" class="add-btn" :id="'AddBtn'+orderIssue.id">
  460. <button type="button" class="btn btn-primary "
  461. @click="showAddDiv('AddLog_'+orderIssue.id)">新
  462. </button>
  463. </div>
  464. <div class="addLogDiv row m-0 p-0 form-group" :id="'AddLog_'+orderIssue.id"
  465. style="display: none;">
  466. <input type="hidden" name="id" :value="orderIssue.id">
  467. <div style="width: 45px"></div>
  468. <div class="form-inline m-2">
  469. <input type="text" name="content" class="form-control m-0 p-0" style="width: 275px"
  470. required>
  471. @cannot('订单管理-问题件-客户不可见')
  472. <input type="checkbox" class="form-control" :name="orderIssue.id + '_log_check'" :id="orderIssue.id + '_log_check'" value="true">
  473. <label :for="orderIssue.id + '_log_check'">标</label>
  474. @endcannot
  475. <button type="button" class="btn btn-primary ml-2 m-0 p-0"
  476. @click="addOrderIssueLog('AddLog_'+orderIssue.id,orderIssue)" style="width: 50px">添加
  477. </button>
  478. </div>
  479. </div>
  480. @endcan
  481. <template v-if="orderIssue.logs && orderIssue.logs.length > 0" class="p-0 m-0">
  482. <table class="table table-sm p-0 m-0 " :id="'logs'+orderIssue.id">
  483. <tr class="align-center position-static" v-for="(log,logIndex) in orderIssue.logs"
  484. @click="removeFocusing($event)" v-on:mouseover="showDelBtn($event)"
  485. v-on:mouseleave="hideDelBtn($event)">
  486. <template v-if="logIndex<2||orderIssue.log_is_show===true">
  487. <td style="max-width: 175px;min-width: 175px;">@{{ log.content }}</td>
  488. <td class="text-muted" style="max-width: 55px;min-width: 55px;">
  489. <span v-if="log.user">@{{ log.user.name}}</span>
  490. </td>
  491. <td class="text-muted" style="max-width: 95px;min-width: 95px;">@{{ log.created_at }}</td>
  492. @can('订单管理-问题件-处理结果删除')
  493. <td style="" class="m-0 p-0 border-0">
  494. <button type="button"
  495. class="btn btn-sm btn-outline-danger m-0 del-btn invisible"
  496. @click="deleteOrderIssueLog(log,orderIssue,index,logIndex)">
  497. </button>
  498. </td>
  499. <td style="" class="m-0 p-0 border-0">
  500. <button type="button" v-show="log.tag === 0"
  501. class="btn btn-sm btn-outline-primary m-0 del-btn invisible"
  502. @click="tagLog(log)">
  503. </button>
  504. </td>
  505. @endcan
  506. </template>
  507. </tr>
  508. </table>
  509. <button type="button" class="btn btn-sm btn-outline-primary align-middle mt-1"
  510. v-if="orderIssue.logs.length > 2" @click="toggleLogs(orderIssue,$event,index)">
  511. 记录共@{{ orderIssue.logs.length }}条,点击展开
  512. </button>
  513. </template>
  514. <div v-else class="w-auto h-50">
  515. </div>
  516. </td>
  517. {{--情况说明 结束--}}
  518. {{--客户编辑 开启--}}
  519. @cannot('订单管理-问题件-客户不可见')
  520. <td class="p-0 m-0 child-layer-3 " style="min-width:50px;" v-if="index===0" :rowspan="orderIssues.length">
  521. <span class="btn text-center"
  522. :class="isShowSecondOrderInfo ?'btn-outline-secondary': 'btn-outline-info'"
  523. @click="togglSecondeOrder" :style="{'min-height':toggleBtnHeight+'px'} ">@{{ isShowSecondOrderInfo ? '隐藏运单列':'展开运单列' }}</span>
  524. </td>
  525. <td class="child-layer-3-hide" v-show="isShowSecondOrderInfo">
  526. @can('订单管理-问题件-编辑')
  527. <input class="form-control form-control-sm"
  528. @change="editSecondClientNo(orderIssue,$event)"
  529. :value="orderIssue.second_client_no">
  530. @else
  531. @{{ orderIssue.second_client_no }}
  532. @endcan
  533. </td>
  534. <td class="child-layer-3-hide" v-show="isShowSecondOrderInfo">
  535. <span v-if="orderIssue.second_order" class="p-0">
  536. <span v-if="orderIssue.second_order.logistic">@{{ orderIssue.second_order.logistic.name }}</span>
  537. </span>
  538. </td>
  539. <td class="log-td p-0 child-layer-3-hide" v-show="isShowSecondOrderInfo"
  540. v-on:mouseover="edit.orderIssue.id=orderIssue.id"
  541. v-on:mouseleave="edit.orderIssue.id = null">
  542. <div class="row position-absolute p-0 m-0" v-if="edit.orderIssue.id === orderIssue.id"
  543. :class="edit.orderIssue.id === orderIssue.id ? '':'d-none'">
  544. <button type="button" class="btn btn-primary " style="margin-top: -35px"
  545. @click="edit.orderIssue.showId === orderIssue.id ? edit.orderIssue.showId='':edit.orderIssue.showId=orderIssue.id">
  546. </button>
  547. </div>
  548. <div class="row p-0 m-0" v-if="edit.orderIssue.showId === orderIssue.id ">
  549. <div class="form-inline">
  550. <input class="form-control" :id="'secondLogisticNumber-'+orderIssue.id">
  551. <button type="button" class="btn btn-sm btn-primary"
  552. @click="addSecondLogisticNumber(orderIssue)">添加
  553. </button>
  554. </div>
  555. </div>
  556. <div v-if="orderIssue.second_order !== null">
  557. <div class="text-center m-0" :id="'secondOrderNumbers'+orderIssue.id"
  558. :class="orderIssue.seconderCount > 1 ? 'collapse':''">
  559. <p class="m-0 p-0 text-muted "
  560. v-for="package in orderIssue.second_order.packages">@{{
  561. package.logistic_number }}</p>
  562. </div>
  563. <button v-if="orderIssue.second_order.packages.length > 1" type="button"
  564. class="btn btn-sm btn-outline-primary align-middle mt-1"
  565. data-toggle="collapse"
  566. :id="'secondOrderNumbersBtn'+orderIssue.id"
  567. :data-target="'#secondOrderNumbers'+orderIssue.id"
  568. @click="toggleseCondOrderNumbers(orderIssue.id,orderIssue.second_order.packages.length)">
  569. 分箱@{{ orderIssue.second_order.packages.length }}件,点击展开
  570. </button>
  571. </div>
  572. <div v-else-if="orderIssue.second_order === null">
  573. @{{orderIssue.second_logistic_number}}
  574. @can('订单管理-问题件-编辑')
  575. <button v-if="orderIssue.second_logistic_number" type="button"
  576. class="btn btn-sm btn-danger ml-1"
  577. @click="destroySecondLogisticNumber(orderIssue)">删
  578. </button>
  579. @endcan
  580. </div>
  581. </td>
  582. <td class="child-layer-3-hide p-0" colspan="3" v-show="isShowSecondOrderInfo">
  583. <template v-if="orderIssue.second_order!==null" class=" p-0">
  584. <div class="m-0 p-0"
  585. :class="orderIssue.second_order.type_numbers > 1 ? 'collapse':''"
  586. :id="'secondOrder'+orderIssue.id">
  587. <table class="table table-sm m-0 ">
  588. <template v-for="packages in orderIssue.second_order.packages">
  589. <tr v-for="item in packages.commodities" v-if="item.commodity">
  590. <td>@{{ item.commodity.sku }}</td>
  591. <td>
  592. <div class="text-truncate text-primary tooltipTarget"
  593. style="width: 100px;cursor:pointer;text-decoration: underline"
  594. title="双击展开" @dblclick="nowrapText($event)">@{{
  595. item.commodity.name }}
  596. </div>
  597. <div class="text-nowrap tooltipTarget"
  598. style="display: none;cursor:pointer"
  599. @dblclick="truncateText($event)" title="双击收起">@{{
  600. item.commodity.name }}
  601. </div>
  602. </td>
  603. <td>@{{ item.amount }}</td>
  604. </tr>
  605. </template>
  606. </table>
  607. </div>
  608. <button type="button" class="btn btn-sm btn-outline-primary align-middle mt-1"
  609. data-toggle="collapse"
  610. v-if="orderIssue.second_order.amounts > 0"
  611. :id="'secondOrderBtn'+orderIssue.id"
  612. :data-target="'#secondOrder'+orderIssue.id"
  613. @click="toggleSecond(orderIssue.id,orderIssue.secondeOrderItems)">
  614. 商品@{{ orderIssue.second_order.amounts }}件,点击展开
  615. </button>
  616. </template>
  617. </td>
  618. @endcannot
  619. @cannot('订单管理-问题件-客户自定义订单号')
  620. <td>
  621. <input class="form-control form-control-sm" :value="orderIssue.custom_code"
  622. @change="updateOrderIssue(orderIssue,'custom_code',$event)">
  623. </td>
  624. @endcan
  625. @cannot('订单管理-问题件-客户不可见')
  626. <td class="child-layer-3">
  627. @can('订单管理-问题件-编辑')
  628. <input type="number" class="form-control form-control-sm"
  629. :value="orderIssue.logistic_indemnity_money"
  630. @change="updateOrderIssue(orderIssue,'logistic_indemnity_money',$event)">
  631. @else
  632. @{{ orderIssue.logistic_indemnity_money }}
  633. @endcan
  634. </td>
  635. <td class="child-layer-3">
  636. @can('订单管理-问题件-编辑')
  637. <select class="form-control form-control-sm"
  638. :value="orderIssue.logistic_express_remission"
  639. @change="updateOrderIssue(orderIssue,'logistic_express_remission',$event)">
  640. <option value></option>
  641. <option v-for="item in expressRemission" :value="item">@{{ item }}</option>
  642. </select>
  643. @else
  644. @{{ orderIssue.logistic_express_remission }}
  645. @endcan
  646. </td>
  647. @endcannot
  648. <td class="child-layer-3">
  649. @can('订单管理-问题件-编辑')
  650. <input type="number" class="form-control form-control-sm"
  651. :value="orderIssue.baoshi_indemnity_money"
  652. @change="updateOrderIssue(orderIssue,'baoshi_indemnity_money',$event)">
  653. @else
  654. @{{ orderIssue.baoshi_indemnity_money }}
  655. @endcan
  656. </td>
  657. <td class="child-layer-3">
  658. @can('订单管理-问题件-编辑')
  659. <select class="form-control form-control-sm"
  660. :value="orderIssue.baoshi_express_remission"
  661. @change="updateOrderIssue(orderIssue,'baoshi_express_remission',$event)">
  662. <option value></option>
  663. <option v-for="item in expressRemission" :value="item">@{{ item }}</option>
  664. </select>
  665. @else
  666. @{{ orderIssue.baoshi_express_remission }}
  667. @endcan
  668. </td>
  669. @cannot('订单管理-问题件-客户不可见')
  670. <td class="child-layer-3">
  671. <table class="table table-sm">
  672. <tr colspan="2">
  673. <td colspan="2">
  674. <select class="form-control form-control-sm"
  675. @change="addUserWorkgroup(orderIssue,'user_workgroup_id',$event)">
  676. <option value></option>
  677. <option v-for="item in userWorkGroup" :value="item.name">@{{ item.value
  678. }}
  679. </option>
  680. </select>
  681. </td>
  682. </tr>
  683. <tr v-for="(user_workgroup,j) in orderIssue.user_workgroups"
  684. v-if="j<2 || orderIssue.is_show_user_workgroup">
  685. <td>@{{ user_workgroup.name }}</td>
  686. <td>
  687. <button class="btn btn-sm btn-outline-danger"
  688. @click="deleteUserWorkgroup(user_workgroup,j,orderIssue)">
  689. 删除
  690. </button>
  691. </td>
  692. </tr>
  693. <tr>
  694. <td colspan="2" v-if="orderIssue.user_workgroups.length > 2">
  695. <div class="row" @click="showUserWorkgroup(orderIssue)"
  696. v-if="orderIssue.user_workgroups.length > 2">
  697. <label class="text-center mt-0 p-0 cursor-pointer offset-5">
  698. <span class="fa"
  699. :class="orderIssue.is_show_user_workgroup ? 'fa-angle-double-down' : 'fa-angle-double-right'"></span>
  700. &nbsp;<span v-if="orderIssue.is_show_user_workgroup">收起</span><span
  701. v-if="!orderIssue.is_show_user_workgroup">展开</span>共@{{
  702. orderIssue.user_workgroups.length }} 条
  703. </label>
  704. </div>
  705. </td>
  706. </tr>
  707. </table>
  708. </td>
  709. <td>
  710. @can('订单管理-问题件-编辑')
  711. <select v-model="orderIssue.user_owner_group_id"
  712. class="form-control form-control-sm"
  713. @change="updateOrderIssue(orderIssue,'user_owner_group_id',$event)">
  714. <option></option>
  715. <option v-for="(userOwnerGroup,index) in userOwnerGroups"
  716. :value="userOwnerGroup.name">@{{ userOwnerGroup.value }}
  717. </option>
  718. </select>
  719. @else
  720. @{{ orderIssue.user_owner_group ? orderIssue.user_owner_group.name : '' }}
  721. @endcan
  722. </td>
  723. {{--客户编辑 结束--}}
  724. <td>
  725. @can('订单管理-问题件-编辑')
  726. <a :href="'edit/'+orderIssue.id" class="btn btn-sm btn-outline-primary"
  727. target="_blank">改</a>
  728. @endcan
  729. @can('订单管理-问题件-删除')
  730. <button type="button" class="btn btn-sm btn-outline-danger"
  731. @click="deleteOrderIssue(orderIssue.id)">删
  732. </button>
  733. @endcan
  734. </td>
  735. @endcannot
  736. </tr>
  737. </tbody>
  738. </table>
  739. <div class="text-info h5 btn btn">{{$orderIssues->count()}}/@{{ total }}</div>
  740. {{$orderIssues->withQueryString()->links()}}
  741. </div>
  742. </div>
  743. {{--batchStore logs--}}
  744. <div class="modal fade" id="batchStoreLogsModel" tabindex="-1" role="dialog" aria-labelledby="logsLabel"
  745. aria-hidden="true">
  746. <div class="modal-dialog modal-dialog-centered">
  747. <div class="modal-content">
  748. <div class="modal-header">
  749. <h5 class="modal-title" id="logsLabel">输入处理内容</h5>
  750. <button type="button" class="close" data-dismiss="modal" aria-label="Close"
  751. @click="edit.batchStoreLogs=''">
  752. <span aria-hidden="true">&times;</span>
  753. </button>
  754. </div>
  755. <div class="modal-body">
  756. <textarea id="logsContent" class="form-control" v-model="edit.batchStoreLogs"></textarea>
  757. </div>
  758. <div class="modal-footer">
  759. <button type="button" class="btn btn-secondary" data-dismiss="modal"
  760. @click="edit.batchStoreLogs=''">取消
  761. </button>
  762. <button type="button" class="btn btn-primary" data-dismiss="modal" @click="batchStoreLogs">确认
  763. </button>
  764. </div>
  765. </div>
  766. </div>
  767. </div>
  768. <div class="modal fade" id="batchOthersModel" tabindex="-1" role="dialog" aria-labelledby="othersLabel"
  769. aria-hidden="true">
  770. <div class="modal-dialog modal-dialog-centered">
  771. <div class="modal-content">
  772. <div class="modal-body">
  773. <h5 class="modal-title" id="othersLabel">承运商赔偿金额</h5>
  774. <input type="number" v-model="edit.batchOthers.logistic_indemnity_money"
  775. class="form-control form-control-sm">
  776. </div>
  777. <div class="modal-body">
  778. <h5 class="modal-title" id="othersLabel">承运商快递减免</h5>
  779. <select class="form-control form-control-sm"
  780. v-model="edit.batchOthers.logistic_express_remission">
  781. <option disabled value="">请选择</option>
  782. <option v-for="item in expressRemission" :value="item">@{{ item }}</option>
  783. </select>
  784. </div>
  785. <div class="modal-body">
  786. <h5 class="modal-title" id="othersLabel">宝时赔偿金额</h5>
  787. <input type="number" v-model="edit.batchOthers.baoshi_indemnity_money"
  788. class="form-control form-control-sm">
  789. </div>
  790. <div class="modal-body">
  791. <h5 class="modal-title" id="othersLabel">宝时快递减免</h5>
  792. <select class="form-control form-control-sm"
  793. v-model="edit.batchOthers.baoshi_express_remission">
  794. <option disabled value="">请选择</option>
  795. <option v-for="item in expressRemission" :value="item">@{{ item }}</option>
  796. </select>
  797. </div>
  798. <div class="modal-body">
  799. <h5 class="modal-title" id="logsLabel">事故责任方</h5>
  800. <span v-for="item in userWorkGroup">
  801. <input v-model="edit.batchOthers.userWorkGroupIds" type="checkbox" name="vehicle"
  802. :value="item.name"/> @{{ item.value }}
  803. </span>
  804. </div>
  805. <div class="modal-footer">
  806. <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
  807. <button type="button" class="btn btn-primary" data-dismiss="modal" @click="batchOthers()">确认
  808. </button>
  809. </div>
  810. </div>
  811. </div>
  812. </div>
  813. {{--delete OrderIssue--}}
  814. <div class="modal fade" id="alertModal" tabindex="-1" role="dialog" aria-labelledby="alertModalLabel"
  815. aria-hidden="true">
  816. <div class="modal-dialog modal-dialog-centered">
  817. <div class="modal-content">
  818. <div class="modal-header">
  819. <h5 class="modal-title" id="exampleModalLabel">提示</h5>
  820. <button type="button" class="close" data-dismiss="modal" aria-label="Close"
  821. @click="changeDeleteId">
  822. <span aria-hidden="true">&times;</span>
  823. </button>
  824. </div>
  825. <div class="modal-body">
  826. <p>是否删除当前订单问题件?</p>
  827. <input type="hidden" id="deleteId" class="form-control">
  828. </div>
  829. <div class="modal-footer">
  830. <button type="button" class="btn btn-secondary" data-dismiss="modal" @click="changeDeleteId">
  831. 取消
  832. </button>
  833. <button type="button" class="btn btn-primary" data-dismiss="modal"
  834. @click="deleteOrderIssueById">确认
  835. </button>
  836. </div>
  837. </div>
  838. </div>
  839. </div>
  840. {{--OrderIssue On Top--}}
  841. <div class="modal fade " id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
  842. aria-hidden="true">
  843. <div class="modal-dialog modal-dialog-centered">
  844. <div class="modal-content">
  845. <div class="modal-header">
  846. <h5 class="modal-title" id="exampleModalLabel">请输入置顶备注</h5>
  847. <button type="button" class="close" data-dismiss="modal" aria-label="Close"
  848. @click="changeRemark">
  849. <span aria-hidden="true">&times;</span>
  850. </button>
  851. </div>
  852. <div class="modal-body">
  853. <input type="hidden" class="form-control" id="onTopId">
  854. <textarea type="text" class="form-control" required id="remark"
  855. @change="changeRemark"></textarea>
  856. <div class="invalid-feedback">
  857. 备注信息不能为空
  858. </div>
  859. </div>
  860. <div class="modal-footer">
  861. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal"
  862. @click="changeRemark">关闭
  863. </button>
  864. <button type="button" class="btn btn-sm btn-primary" @click="submitOnTop">提交</button>
  865. </div>
  866. </div>
  867. </div>
  868. </div>
  869. <textarea id="clipboardDiv" style="opacity:0"></textarea>
  870. </div>
  871. @endsection
  872. @section('lastScript')
  873. <style type="text/css">
  874. @keyframes anima {
  875. from {
  876. opacity: 0.1;
  877. }
  878. to {
  879. opacity: 1;
  880. }
  881. }
  882. @-webkit-keyframes anima {
  883. from {
  884. opacity: 0.75;
  885. }
  886. to {
  887. opacity: 0.1;
  888. }
  889. }
  890. .tr_top {
  891. min-height: 75px;
  892. }
  893. .bg-light-yellow {
  894. background: #fffff8;
  895. }
  896. .top {
  897. padding-top: 0px;
  898. padding-left: 10px;
  899. margin-top: -4px;
  900. margin-left: -5px;
  901. line-height: 75px;
  902. position: absolute;
  903. animation: anima;
  904. animation-duration: 3s;
  905. animation-timing-function: cubic-bezier(0, 0, 1, 1);
  906. animation-direction: alternate;
  907. animation-play-state: running;
  908. -webkit-animation-name: anima;
  909. -webkit-animation-duration: 3s;
  910. -webkit-animation-timing-function: cubic-bezier(0, 0, 1, 1);
  911. -webkit-animation-iteration-count: infinite;
  912. -webkit-animation-direction: alternate;
  913. -webkit-animation-play-state: running;
  914. }
  915. </style>
  916. <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
  917. <script type="text/javascript" src="{{mix('js/queryForm/export.js')}}"></script>
  918. <script>
  919. let listVue = new Vue({
  920. el: '#issue_div',
  921. data: {
  922. orderIssues: {!! $orderIssues->toJson() !!}['data'],
  923. owners: [@foreach($owners as $owner){name: '{{ $owner->id }}', value: '{{ $owner->name}}'},@endforeach],
  924. orderIssueType: [
  925. @foreach($orderIssueType as $type)
  926. {
  927. name: '{{$type->id}}', value: '{{$type->name}}'
  928. },
  929. @endforeach],
  930. qualityLabel: [
  931. @foreach($qualityLabel as $type)
  932. {
  933. name: '{{$type->id}}', value: '{{$type->name}}'
  934. },
  935. @endforeach],
  936. userWorkGroup: [
  937. @foreach($userWorkgroup as $item)
  938. {
  939. name:{{$item->id}}, value: '{{$item->name}}'
  940. },
  941. @endforeach
  942. {name:'空',value:'空'},
  943. ],
  944. userOwnerGroups:{!! $userOwnerGroups !!},
  945. rejectingStatus: [
  946. {name: '无', value: '无'},
  947. {name: '未退回', value: '未退回'},
  948. {name: '全部退回', value: '全部退回'},
  949. {name: '部分退回', value: '部分退回'},
  950. {name: '差异退回', value: '差异退回'},
  951. {name: '超量退回', value: '超量退回'},
  952. ],
  953. logistics: [
  954. @foreach($logistics as $logistic)
  955. {
  956. name:{{$logistic->id}}, value: '{{$logistic->name}}'
  957. },
  958. @endforeach
  959. ],
  960. expressRemission: ['原单减免', '补发减免', '全部减免'],
  961. checkData: [],
  962. from: '',
  963. finalStatus: [{value: '', name: ""}, {value: '已解决', name: "已解决"}, {
  964. value: '待退回',
  965. name: "待退回"
  966. }, {value: '退回中', name: "退回中"}, {value: '已归档', name: "已归档"},],//['无','已解决', '待退回', '退回中','已归档'],
  967. selectedStyle: '',
  968. deleteId: '',
  969. total: {!! $orderIssues->toJson() !!}['total'],
  970. isShowOrderInfo: false,
  971. isShowRejectedBill: false,
  972. isShowSecondOrderInfo: false,
  973. message: {},
  974. edit: {
  975. batchStoreLogs: '',
  976. batchOthers: {
  977. logistic_indemnity_money: null,
  978. logistic_express_remission: null,
  979. baoshi_indemnity_money: null,
  980. baoshi_express_remission: null,
  981. userWorkGroupIds: []
  982. },
  983. isShow: [],
  984. addSendOrderIssueID: '',
  985. orderIssue: {id: null, showId: ''},
  986. },
  987. toggleBtnHeight: null,
  988. },
  989. created() {
  990. let _this = this;
  991. $.each(this.orderIssues, function (i, orderIssue) {
  992. _this.regroupOrder(orderIssue.order);
  993. _this.regroupOrder(orderIssue.second_order);
  994. _this.regroupRejectedBill(orderIssue);
  995. _this.regroupLogs(orderIssue);
  996. _this.regroupUserGroup(orderIssue);
  997. });
  998. this.userOwnerGroups.forEach(function (item, index, array) {
  999. array[index] = {name: item.id, value: item.name};
  1000. });
  1001. },
  1002. mounted: function () {
  1003. $(".tooltipTarget").tooltip({'trigger': 'hover'});
  1004. let tr = $('.tr-yellow')[1];
  1005. let countShow = $(tr).children('.one-layer').length;
  1006. $('.header-1').attr('colspan', countShow);
  1007. $('[data-toggle="tooltip"]').tooltip({'trigger': 'hover'})
  1008. $('#list').removeClass("d-none");
  1009. let _this = this;
  1010. let log_content_range = [{name: '15', value: '15天内'}, {name: '31', value: '近一月'}, {
  1011. name: '92',
  1012. value: '近三月'
  1013. }, {name: '183', value: '近半年'}, {name: '366', value: '近一年'}, {name: '0', value: '不限'},];
  1014. let final_status = [
  1015. {name: 'null', value: '无'},
  1016. {name: '已解决', value: '已解决'},
  1017. {name: '待退回', value: '待退回'},
  1018. {name: '退回中', value: '退回中'},
  1019. {name: '已归档', value: '已归档'},
  1020. ];
  1021. let imported_status = [{name: '导入未处理', value: '导入未处理'}, {name: '导入已梳理', value: '导入已处理'}]
  1022. let data = [[
  1023. {name: 'created_at_start', type: 'dateTime', tip: '登记开始日期'},
  1024. {
  1025. name: 'owner',
  1026. type: 'select_multiple_select',
  1027. tip: ['输入关键词快速定位下拉列表,回车确定', '选择要显示的客户'],
  1028. placeholder: ['货主', '定位或多选货主'],
  1029. data: _this.owners
  1030. },
  1031. {name: 'client_code', type: 'input', tip: '可支持多客户订单号:前或后加百分号为单个模糊搜索,否则为多条件精确搜索', placeholder: '客户订单号'},
  1032. {
  1033. name: 'logistic_number',
  1034. type: 'input',
  1035. tip: ['可支持原始运单号:前或后加百分号为单个模糊搜索,否则为多条件精确搜索'],
  1036. placeholder: '原始运单号'
  1037. },
  1038. {
  1039. name: 'logistic',
  1040. type: 'select_multiple_select',
  1041. tip: ['输入关键词快速定位下拉列表,回车确定', '选择要显示的承运商'],
  1042. placeholder: ['承运商', '定位或多选承运商'],
  1043. data: this.logistics
  1044. },
  1045. {
  1046. name: 'logistic_number_return',
  1047. type: 'input',
  1048. tip: '可支持多退回单号:前或后加百分号为单个模糊搜索,否则为多条件精确搜索',
  1049. placeholder: '退回单号'
  1050. },
  1051. // {name: 'send_client_code', type: 'input', tip: '二次订单号:前或后加百分号为单个模糊搜索,否则为多条件精确搜索', placeholder: '二次订单号'},
  1052. {
  1053. name: ['shop_name', 'shop_name_limit_time'],
  1054. type: 'input_select',
  1055. tip: ['商铺:前或后加 百分号为单个模糊搜索,默认添加后%,否则为多条件精确搜索', '查询范围越短,搜索速度越快'],
  1056. placeholder: ['店铺', ''],
  1057. data: log_content_range,
  1058. rules: [{
  1059. son: {
  1060. shop_name_limit_time: {
  1061. default: '15',
  1062. required_without_all_if: ['created_at_start', 'created_at_end']
  1063. }
  1064. }
  1065. }]
  1066. },
  1067. {
  1068. name: 'user_owner_group',
  1069. type: 'select',
  1070. tip: '项目责任方',
  1071. placeholder: '项目责任方',
  1072. data: this.userOwnerGroups
  1073. },
  1074. ], [
  1075. {name: 'created_at_end', type: 'dateTime', tip: '登记结束日期'},
  1076. {name: 'consignee_name', type: 'input', tip: '可支持多收货人名称:前或后加百分号为单个模糊搜索,否则为多条件精确搜索', placeholder: '收货人名称'},
  1077. {name: 'consignee_phone', type: 'input', tip: '可支持多收货人电话:前或后加百分号为单个模糊搜索,否则为多条件精确搜索', placeholder: '收货人电话'},
  1078. {name: 'good_barcode', type: 'input', tip: '可支持多条码:前或后加 百分号为单个模糊搜索,否则为多条件精确搜索', placeholder: '条码'},
  1079. {name: 'good_name', type: 'input', tip: '可支持多商品名:前或后加 百分号为单个模糊搜索,否则为多条件精确搜索', placeholder: '商品名'},
  1080. {name: 'id_quality_label', type: 'select', tip: '是否正品', placeholder: '是否正品', data: this.qualityLabel},
  1081. {name: 'is_imported', type: 'select', tip: '是否导入处理', placeholder: '是否导入处理', data: imported_status},
  1082. {
  1083. name: 'workgroups',
  1084. type: 'select_multiple_select',
  1085. tip: ['事故责任方', ''],
  1086. placeholder: ['事故责任方', ''],
  1087. data: this.userWorkGroup
  1088. },
  1089. ], [
  1090. @cannot('订单管理-问题件-客户不可见')
  1091. {
  1092. name: 'logistic_indemnity_money',
  1093. type: 'select',
  1094. tip: '承运商赔偿金额',
  1095. placeholder: '承运商赔偿金额',
  1096. data: [{name: '是', value: '是'}, {name: '否', value: '否'}]
  1097. },
  1098. @endcannot
  1099. {
  1100. name: 'baoshi_indemnity_money',
  1101. type: 'select',
  1102. tip: '宝时赔偿金额',
  1103. placeholder: '宝时赔偿金额',
  1104. data: [{name: '是', value: '是'}, {name: '否', value: '否'}]
  1105. },
  1106. @cannot('订单管理-问题件-客户不可见')
  1107. {
  1108. name: 'final_status', type: 'select', tip: '问题件的最终状态', placeholder: '最终状态', data: final_status
  1109. },
  1110. {
  1111. name: 'order_issue_type',
  1112. type: 'select_multiple_select',
  1113. tip: ['问题类别', ''],
  1114. placeholder: ['问题类别', ''],
  1115. data: this.orderIssueType
  1116. },
  1117. @endcannot
  1118. {
  1119. name: ['log_content', 'addtime'],
  1120. type: 'input_select',
  1121. tip: ['处理结果:前或后加 百分号为单个模糊搜索,否则为多条件精确搜索', '查询范围越短,搜索速度越快'],
  1122. placeholder: ['处理结果', ''],
  1123. data: log_content_range,
  1124. rules: [{
  1125. son: {
  1126. addtime: {
  1127. default: '31',
  1128. required_without_all_if: ['created_at_start', 'created_at_end']
  1129. }
  1130. }
  1131. }]
  1132. },
  1133. {
  1134. name: 'finance_confirm',
  1135. type: 'select',
  1136. tip: '财务确认',
  1137. placeholder: '财务确认是/否',
  1138. data: [{name: '是', value: '是'}, {name: '否', value: '否'}]
  1139. },
  1140. {
  1141. name: ['result_explain', 'addtime'],
  1142. type: 'input_select',
  1143. tip: ['情况说明:前或后加 百分号为单个模糊搜索,否则为多条件精确搜索', '查询范围越短,搜索速度越快'],
  1144. placeholder: ['情况说明', ''],
  1145. data: log_content_range,
  1146. rules: [{
  1147. son: {
  1148. addtime: {
  1149. default: '31',
  1150. required_without_all_if: ['created_at_start', 'created_at_end']
  1151. }
  1152. }
  1153. }]
  1154. }
  1155. ], [
  1156. {name: 'settlement_at_start', type: 'dateTime', tip: '完结起始日期'},
  1157. {name: 'settlement_at_end', type: 'dateTime', tip: '完结结束日期'},
  1158. {name: 'hiddenTag', type: 'input', tip: '隐藏标识', placeholder: '标识'},
  1159. {
  1160. name: 'is_new_rejecting',
  1161. type: 'select',
  1162. tip: '退件状态',
  1163. placeholder: '退件状态',
  1164. data: [{name: '无', value: '无'}, {name: '有', value: '有'}, {name: '已处理', value: '已处理'}]
  1165. },
  1166. {
  1167. name: 'rejectingStatus',
  1168. type: 'select',
  1169. tip: '退单状态',
  1170. placeholder: '退单状态',
  1171. data: this.rejectingStatus
  1172. },
  1173. {name: 'sendOrderClientCode', type: 'input', tip: '二次客户订单号', placeholder: '二次客户订单号'},
  1174. {name: 'sendOrderLogisticNumber', type: 'input', tip: '二次运单号', placeholder: '二次运单号'},
  1175. {name: 'custom_code', type: 'input', tip: '自定义订单号:自定义订单号', placeholder: '自定义订单号'},
  1176. ],
  1177. [
  1178. @cannot('订单管理-问题件-客户不可见')
  1179. {name: 'archive_at_start', type: 'dateTime', tip: '归档起始日期'},
  1180. {name: 'archive_at_end', type: 'dateTime', tip: '归档结束日期'},
  1181. @endcannot
  1182. {name: 'is_handle', type: 'checkbox', tip: '是否已处理', data: [{name: 'ture', value: '已解决'}]},
  1183. {name: 'is_intercept', type: 'checkbox', tip: '是否已拦截', data: [{name: 'ture', value: '已拦截'}]},
  1184. ]
  1185. ];
  1186. this.form = new query({
  1187. el: '#form_div',
  1188. condition: data,
  1189. appendDom: "btn",
  1190. paginations: [50, 100, 200, 500, 1000, 20],
  1191. })
  1192. this.form.init();
  1193. let order = $('.table-head-warning')[0];
  1194. $('.top').css('min-width', $(order).outerWidth(true)-50);
  1195. this._initializePage();
  1196. },
  1197. watch: {
  1198. checkData: {
  1199. handler() {
  1200. if (this.checkData.length === this.orderIssues.length) {
  1201. document.querySelector('#all').checked = true;
  1202. } else {
  1203. document.querySelector('#all').checked = false;
  1204. }
  1205. },
  1206. deep: true
  1207. },
  1208. isShowOrderInfo(newValue) {
  1209. setTimeout(function () {
  1210. $('.header-2').attr('colspan', 8 + (newValue ? 9 : 0));
  1211. }, 2);
  1212. },
  1213. isShowRejectedBill(newValue) {
  1214. let _this = this;
  1215. setTimeout(function () {
  1216. $('.header-3').attr('colspan', 14 + (_this.isShowSecondOrderInfo ? 6 : 0) + (newValue ? 6 : 0));
  1217. }, 2);
  1218. },
  1219. isShowSecondOrderInfo(newValue) {
  1220. let _this = this;
  1221. setTimeout(function () {
  1222. $('.header-3').attr('colspan', 14 + (newValue ? 6 : 0) + (_this.isShowRejectedBill ? 6 : 0));
  1223. }, 2);
  1224. },
  1225. },
  1226. methods: {
  1227. _initializePage() {
  1228. this.toggleBtnHeight = document.getElementById('tbody').clientHeight;
  1229. this.isShowOrderInfo = false;
  1230. this.isShowRejectedBill = false;
  1231. this.isShowSecondOrderInfo = false;
  1232. },
  1233. regroupOrder(order) {
  1234. if (!order) return;
  1235. let amounts = 0; // 商品总数
  1236. let type_numbers = 0; // 商品类型数量
  1237. $.each(order.packages, function (i, package) {
  1238. $.each(package.commodities, function (i, commodity) {
  1239. type_numbers++;
  1240. amounts += commodity.amount;
  1241. });
  1242. });
  1243. order.amounts = amounts;
  1244. order.type_numbers = type_numbers;
  1245. },
  1246. regroupRejectedBill(orderIssue) {
  1247. if (!orderIssue) return;
  1248. if (!orderIssue.order_issue_rejected_bills) return;
  1249. let amounts = 0;// 商品总数
  1250. let type_numbers = 0; // 商品类型数量
  1251. $.each(orderIssue.order_issue_rejected_bills, function (i, order_issue_rejected_bill) {
  1252. if (order_issue_rejected_bill.rejected_bill) {
  1253. $.each(order_issue_rejected_bill.rejected_bill.items, function (i, item) {
  1254. type_numbers++;
  1255. amounts += item.amount;
  1256. });
  1257. }
  1258. });
  1259. orderIssue.rejected_bill_amounts = amounts;
  1260. orderIssue.rejected_bill_type_numbers = type_numbers;
  1261. },
  1262. regroupLogs(orderIssue) {
  1263. if (!orderIssue) return;
  1264. if (!orderIssue.logs) return;
  1265. if (orderIssue.logs.length < 2) {
  1266. orderIssue.log_is_show = true;
  1267. } else {
  1268. orderIssue.log_is_show = false;
  1269. }
  1270. },
  1271. regroupUserGroup(orderIssue) {
  1272. orderIssue.is_show_user_workgroup = false;
  1273. },
  1274. displayDelBtn(bool, e) {
  1275. if (bool) $(e.target).next().removeClass('d-none');
  1276. else {
  1277. setTimeout(function () {
  1278. $(e.target).next().addClass('d-none');
  1279. }, 100);
  1280. }
  1281. },
  1282. selectedColor(orderno, e) {
  1283. $('.table-body').removeClass('focusing')
  1284. if (orderno === this.selectedStyle) {
  1285. this.selectedStyle = '';
  1286. return;
  1287. }
  1288. this.selectedStyle = orderno;
  1289. $(e.target).parent('tr').addClass('focusing')
  1290. },
  1291. deleteOrderIssue(id) {
  1292. $('#deleteId').val(id);
  1293. $('#alertModal').modal('show');
  1294. },
  1295. deleteOrderIssueById() {
  1296. let _this = this;
  1297. tempTip.setDuration(99999)
  1298. tempTip.waitingTip('删除中,请稍候')
  1299. let id = $('#deleteId').val();
  1300. let data = {id: id};
  1301. axios.post('{{url('apiLocal/order/issue/destroy')}}', data).then(function (res) {
  1302. tempTip.cancelWaitingTip();
  1303. if (res.data.success) {
  1304. for (let i = 0; i < _this.orderIssues.length; i++) {
  1305. if (_this.orderIssues[i].id == id) {
  1306. _this.orderIssues.splice(i, 1);
  1307. _this.deleteId = 0;
  1308. break;
  1309. }
  1310. }
  1311. tempTip.setDuration(2000);
  1312. tempTip.showSuccess('删除成功');
  1313. return;
  1314. }
  1315. tempTip.setDuration(2500);
  1316. tempTip.show('删除失败,错误:' + res.data.fail_info);
  1317. }).catch(function (err) {
  1318. tempTip.cancelWaitingTip();
  1319. tempTip.setDuration(4000);
  1320. tempTip.show('网络错误:' + err);
  1321. });
  1322. this.changeDeleteId();
  1323. },
  1324. changeDeleteId() {
  1325. $('#deleteId').val('');
  1326. },
  1327. cancelOnTop(id) {
  1328. axios.post('{{url('apiLocal/order/issue/onTop/cancelTop')}}', {id: id})
  1329. .then(function (res) {
  1330. if (res.data.success) {
  1331. tempTip.setDuration(2000);
  1332. tempTip.showSuccess('订单问题件取消置顶成功!');
  1333. window.location.reload();
  1334. return;
  1335. }
  1336. tempTip.setDuration(2500);
  1337. tempTip.show(res.data.fail_info);
  1338. }).catch(function (err) {
  1339. tempTip.setDuration(4000);
  1340. tempTip.show('网络错误:' + err);
  1341. });
  1342. },
  1343. changeRemark() {
  1344. $('#remark').removeClass('is-invalid');
  1345. },
  1346. OrderIssueOnTop(id) {
  1347. $("#onTopId").val(id);
  1348. $("#exampleModal").modal('show');
  1349. },
  1350. submitOnTop() {
  1351. let _this = this;
  1352. let remark = $("#remark").val();
  1353. let id = $("#onTopId").val();
  1354. if (remark === '' || remark == null) {
  1355. $('#remark').focus().addClass('is-invalid');
  1356. return;
  1357. }
  1358. axios.post('{{url('apiLocal/order/issue/onTop/store')}}', {id: id, remark: remark})
  1359. .then(function (res) {
  1360. $("#exampleModal").modal('hide');
  1361. if (res.data.success) {
  1362. $.each(_this.orderIssues, function (i, orderIssue) {
  1363. if (orderIssue.id == id) {
  1364. orderIssue.top = res.data.data;
  1365. _this.orderIssues.unshift(_this.orderIssues.splice(i, 1).shift());
  1366. }
  1367. });
  1368. tempTip.setDuration(2500);
  1369. tempTip.showSuccess('置顶成功');
  1370. window.location.reload();
  1371. return;
  1372. }
  1373. tempTip.setDuration(2500);
  1374. tempTip.show(res.data.fail_info);
  1375. }).catch(function (err) {
  1376. $("#exampleModal").modal('hide');
  1377. tempTip.setDuration(4000);
  1378. tempTip.show('网络错误:' + err);
  1379. });
  1380. },
  1381. orderIssueExport(sign) {
  1382. let url = '{{url('order/issue/export')}}';
  1383. let token = '{{ csrf_token() }}';
  1384. if (sign) {
  1385. excelExport(true, this.checkData, url, this.total, token);
  1386. } else {
  1387. excelExport(false, this.checkData, url, null, token);
  1388. }
  1389. },
  1390. copyOrderNo() {
  1391. let _this = this;
  1392. if (this.checkData.length === 0) {
  1393. tempTip.show('没有勾选订单');
  1394. return;
  1395. }
  1396. let orderNos = [];
  1397. $.each(this.orderIssues, function (index, orderIssue) {
  1398. if (_this.checkData.includes(orderIssue.id)) {
  1399. if (orderIssue.order.packages) {
  1400. $.each(orderIssue.order.packages, function (i, package) {
  1401. orderNos.push(package.logistic_number);
  1402. });
  1403. }
  1404. }
  1405. });
  1406. if (orderNos.length === 0) {
  1407. tempTip.setDuration(2200);
  1408. tempTip.show('勾选的问题件没有对应的快递单号');
  1409. return;
  1410. }
  1411. this.copyText(orderNos.join('\n'));
  1412. },
  1413. copyText(text) {
  1414. try {
  1415. $('#clipboardDiv').text(text).select().focus();
  1416. document.execCommand("Copy");
  1417. tempTip.setIndex(1052)
  1418. tempTip.setDuration(2000)
  1419. tempTip.showSuccess('复制成功')
  1420. } catch (e) {
  1421. tempTip.setIndex(1052)
  1422. tempTip.setDuration(2000)
  1423. tempTip.showSuccess('复制失败:' + e)
  1424. }
  1425. },
  1426. copyRejectedLogisticNumber(){
  1427. let _this = this ;
  1428. if (this.checkData.length === 0) {
  1429. tempTip.show('没有勾选订单');
  1430. return;
  1431. }
  1432. let logisticNumbers = [];
  1433. $.each(this.orderIssues, function (index, orderIssue) {
  1434. if (_this.checkData.includes(orderIssue.id)) {
  1435. if (orderIssue.order_issue_rejected_bills) {
  1436. $.each(orderIssue.order_issue_rejected_bills, function (i, rejectedBill) {
  1437. logisticNumbers.push(rejectedBill.logistic_number_return);
  1438. });
  1439. }
  1440. }
  1441. });
  1442. if (logisticNumbers.length === 0) {
  1443. tempTip.setDuration(2200);
  1444. tempTip.show('勾选的问题件没有对应的退回单号');
  1445. return;
  1446. }
  1447. this.copyText(logisticNumbers.join('\n'));
  1448. },
  1449. checkAll(e) {
  1450. if (!e.target.checked) this.checkData = [];
  1451. else {
  1452. this.orderIssues.forEach((el, i) => {
  1453. if (this.checkData.indexOf(el.id) === -1) this.checkData.push(el.id);
  1454. });
  1455. }
  1456. },
  1457. endOrderIssue() {
  1458. if (this.checkData.length !== 0) {
  1459. this.endOrderIssues(this.checkData)
  1460. return;
  1461. }
  1462. tempTip.show('没有勾选订单');
  1463. },
  1464. disposeOrderIssue(orderIssue) {
  1465. let data = {id: orderIssue.id};
  1466. axios.post('{{url('apiLocal/order/issue/disposeOrderIssue')}}', data).then(function (res) {
  1467. if (res.data.success) {
  1468. orderIssue.is_new_rejecting = '已处理'
  1469. tempTip.setDuration(3000);
  1470. tempTip.showSuccess('订单已处理');
  1471. return;
  1472. }
  1473. tempTip.setDuration(3000);
  1474. tempTip.show(res.data.fail_info);
  1475. }).catch(function (err) {
  1476. tempTip.setDuration(4000);
  1477. tempTip.show('网路链接异常' + err);
  1478. });
  1479. },
  1480. endOrderIssueById(id) {
  1481. this.endOrderIssues([id]);
  1482. },
  1483. endOrderIssues(ids) {
  1484. let data = {ids: ids}
  1485. let orderIssues = {};
  1486. let _this = this;
  1487. for (let i = 0; i < this.orderIssues.length; i++) {
  1488. let id = this.orderIssues[i]['id']
  1489. if (ids.includes(id)) orderIssues[id] = this.orderIssues[i];
  1490. }
  1491. axios.post('{{url('apiLocal/order/issue/endOrderIssues')}}', data).then(function (response) {
  1492. if (response.data.success) {
  1493. tempTip.setDuration(3000)
  1494. tempTip.showSuccess('订单已处理')
  1495. let logs = response.data.logs;
  1496. for (let i = 0; i < logs.length; i++) {
  1497. let log = logs[i]
  1498. let orderIssue = orderIssues[log['order_issue_id']]
  1499. if (orderIssue) {
  1500. orderIssue.logs.unshift(log)
  1501. orderIssue['final_status'] = '已解决'
  1502. }
  1503. }
  1504. return;
  1505. }
  1506. tempTip.setDuration(3000)
  1507. tempTip.show(response.data.fail_info)
  1508. }).catch(function (error) {
  1509. tempTip.setDuration(4000)
  1510. tempTip.show('网路链接异常' + error);
  1511. })
  1512. },
  1513. addOrderIssueLog(id, orderIssue) {
  1514. let idInput = $('#' + id + ' :input[name="id"]');
  1515. let contentInput = $('#' + id + ' :input[name="content"]');
  1516. if (!contentInput.val()) {
  1517. contentInput.addClass('is-invalid').focus();
  1518. return;
  1519. }
  1520. contentInput.removeClass('is-invalid');
  1521. let tag = document.getElementById(orderIssue.id + '_log_check').checked;
  1522. let url = '{{route('order.issue.log.storeApi')}}';
  1523. let data = {id: idInput.val(), content: contentInput.val(),tag:tag ? 1: 0};
  1524. axios.post(url, data).then(function (res) {
  1525. if (res.data.success) {
  1526. orderIssue.logs.unshift(res.data.data);
  1527. contentInput.val('');
  1528. $('#' + id).hide();
  1529. tempTip.setDuration(2000);
  1530. tempTip.showSuccess('添加成功');
  1531. return;
  1532. }
  1533. tempTip.setDuration(3000);
  1534. tempTip.show(res.data.fail_info);
  1535. }).catch(function (err) {
  1536. tempTip.setDuration(4000);
  1537. tempTip.show('网络异常:' + err);
  1538. });
  1539. },
  1540. deleteOrderIssueLog(log, orderIssue, index, logIndex) {
  1541. if (!confirm('是否删除当前记录')) return;
  1542. if (log.type === '创建') {
  1543. tempTip.show('创建记录不能删除');
  1544. return;
  1545. }
  1546. axios.post("{{url('apiLocal/order/issue/log/destroy')}}", {id: log.id}).then(function (res) {
  1547. if (res.data.success) {
  1548. if (log.type === '结束') orderIssue.final_status = '';
  1549. orderIssue.logs.splice(logIndex, 1);
  1550. tempTip.setDuration(2000);
  1551. tempTip.showSuccess('删除成功');
  1552. return;
  1553. }
  1554. tempTip.setDuration(2000);
  1555. tempTip.show('删除失败:' + res.data.fail_info);
  1556. }).catch(function (err) {
  1557. tempTip.setDuration(4000);
  1558. tempTip.show('网络异常:' + err);
  1559. });
  1560. },
  1561. hidetop: function (e) {
  1562. let target = $(e.target);
  1563. let top = target.parent().find('.top');
  1564. let tip = target.parent().find('.toptd');
  1565. top.hide();
  1566. tip.tooltip('show');
  1567. },
  1568. showtop: function (e) {
  1569. let target = $(e.target);
  1570. let top = target.parent().find('.top');
  1571. let tip = target.parent().find('.toptd');
  1572. top.show();
  1573. tip.tooltip('hide');
  1574. },
  1575. showDelBtn(e) {
  1576. let domObj = $(e.target).parent();
  1577. domObj.find('.del-btn').addClass('visible').removeClass('invisible');
  1578. },
  1579. hideDelBtn(e) {
  1580. let domObj = $(e.target);
  1581. domObj.find('.del-btn').addClass('invisible').removeClass('visible');
  1582. },
  1583. showAddBtn(e) {
  1584. let domObj = $(e.target).parents('.log-td');
  1585. if (domObj.hasClass('log-td')) {
  1586. domObj.find('.add-btn').show();
  1587. } else {
  1588. let obj = $(e.target);
  1589. if (obj.hasClass('log-td')) {
  1590. obj.find('.add-btn').show();
  1591. }
  1592. }
  1593. },
  1594. hideAddBtn(e) {
  1595. let domObj = $(e.target);
  1596. if (domObj.hasClass('log-td')) {
  1597. domObj.find('.add-btn').hide();
  1598. }
  1599. },
  1600. showAddDiv(id) {
  1601. let div = $('#' + id);
  1602. if (div.is(":hidden")) {
  1603. div.show();
  1604. div.find('input[type=text]').focus();
  1605. } else {
  1606. div.hide();
  1607. }
  1608. },
  1609. toggleLogisticNumbers(id, length) {
  1610. let collapse = $('#logisticNumbers' + id);
  1611. let button = $("#logisticNumbersBtn" + id);
  1612. let isShow = button.attr('aria-expanded');
  1613. if (isShow === 'false') {
  1614. button.text('点击收起');
  1615. } else {
  1616. button.text("分箱" + length + "件,点击展开");
  1617. }
  1618. },
  1619. toggleLogs(orderIssue, e, index) {
  1620. if (orderIssue.log_is_show === false) {
  1621. orderIssue.log_is_show = true;
  1622. this.$set(this.orderIssues, index, orderIssue);
  1623. $(e.target).text('点击收起');
  1624. } else {
  1625. orderIssue.log_is_show = false;
  1626. this.$set(this.orderIssues, index, orderIssue);
  1627. $(e.target).text("记录共" + orderIssue.logs.length + "条,点击展开");
  1628. }
  1629. },
  1630. toggleOrder(id, length) {
  1631. let button = $("#orderBtn" + id);
  1632. let isShow = button.attr('aria-expanded');
  1633. if (isShow === 'false') {
  1634. button.text('点击收起');
  1635. } else {
  1636. button.text("商品" + length + "件,点击展开");
  1637. }
  1638. },
  1639. toggleSecond(id, length) {
  1640. let button = $("#secondOrderBtn" + id);
  1641. let isShow = button.attr('aria-expanded');
  1642. if (isShow === 'false') {
  1643. button.text('点击收起');
  1644. } else {
  1645. button.text("商品" + length + "件,点击展开");
  1646. }
  1647. },
  1648. toggleRejectedBillItems(id, length) {
  1649. let button = $("#rejectedBillBtn" + id);
  1650. let isShow = button.attr('aria-expanded');
  1651. if (isShow === 'false') {
  1652. button.text('点击收起');
  1653. } else {
  1654. button.text("商品" + length + "件,点击展开");
  1655. }
  1656. },
  1657. toggleseCondOrderNumbers(id, length) {
  1658. let button = $("#secondOrderNumbersBtn" + id);
  1659. let isShow = button.attr('aria-expanded');
  1660. if (isShow === 'false') {
  1661. button.text('点击收起');
  1662. } else {
  1663. button.text("分箱" + length + "件,点击展开");
  1664. }
  1665. },
  1666. toggleOrderInfo() {
  1667. this.isShowOrderInfo = !this.isShowOrderInfo;
  1668. },
  1669. toggleRejectedBill() {
  1670. this.isShowRejectedBill = !this.isShowRejectedBill;
  1671. },
  1672. togglSecondeOrder() {
  1673. this.isShowSecondOrderInfo = !this.isShowSecondOrderInfo;
  1674. },
  1675. updateOrderIssue(orderIssue, column, e) {
  1676. let value = $(e.target).val()
  1677. if (column === 'imported_status') value = '导入已梳理'
  1678. if (column === 'final_status' && value === '已解决') {
  1679. this.endOrderIssueById(orderIssue['id'])
  1680. return;
  1681. }
  1682. let data = {id: orderIssue['id'], column: column, value: value}
  1683. axios.post('{{url("apiLocal/order/issue/updateColumn")}}', data).then(function (response) {
  1684. if (response.data.success) {
  1685. orderIssue[column] = data.value
  1686. tempTip.setDuration(2000)
  1687. tempTip.showSuccess('修改成功')
  1688. return;
  1689. }
  1690. tempTip.setDuration(3000)
  1691. tempTip.show('修改失败:' + response.data.fail_info)
  1692. }).catch(function (error) {
  1693. tempTip.setDuration(3000)
  1694. tempTip.show('修改出现异常:' + error)
  1695. })
  1696. },
  1697. batchDeleteOrderIssue() {
  1698. if (this.checkData.length === 0) {
  1699. tempTip.setDuration(2000)
  1700. tempTip.show('没有勾选内容')
  1701. return;
  1702. }
  1703. if (!confirm('是否删除当前问题件')) return;
  1704. let _this = this
  1705. let data = {ids: this.checkData}
  1706. axios.post('{{url('apiLocal/order/issue/batchDestroy')}}', data).then(function (response) {
  1707. if (response.data.success) {
  1708. for (let index = _this.orderIssues.length - 1; index >= 0; index--) {
  1709. let item = _this.orderIssues[index]
  1710. if (_this.checkData.includes(item.id)) _this.orderIssues.splice(index, 1)
  1711. }
  1712. _this.checkData = []
  1713. tempTip.setDuration(2000)
  1714. tempTip.showSuccess('删除成功')
  1715. return;
  1716. }
  1717. tempTip.setDuration('删除失败')
  1718. }).catch(function (error) {
  1719. tempTip.setDuration(3000)
  1720. tempTip.show('删除异常:' + error)
  1721. })
  1722. },
  1723. batchStoreLogsModel() {
  1724. if (this.checkData.length === 0) {
  1725. tempTip.setDuration(2000)
  1726. tempTip.show('没有勾选内容')
  1727. return;
  1728. }
  1729. $("#batchStoreLogsModel").modal('show');
  1730. },
  1731. batchOthersModel() {
  1732. if (this.checkData.length === 0) {
  1733. tempTip.setDuration(2000)
  1734. tempTip.show('没有勾选内容')
  1735. return;
  1736. }
  1737. $("#batchOthersModel").modal('show');
  1738. },
  1739. batchStoreLogs() {
  1740. let _this = this;
  1741. let data = {orderIssueIds: this.checkData, content: this.edit.batchStoreLogs};
  1742. axios.post('{{url("apiLocal/order/issue/log/batchStore")}}', data).then(function (response) {
  1743. if (response.data.success) {
  1744. _this.edit.batchStoreLogs = ''
  1745. let logs = response.data.logs
  1746. _this.orderIssues.forEach(function (item) {
  1747. let id = item['id']
  1748. if (_this.checkData.includes(id)) {
  1749. item['logs'].unshift(logs[id])
  1750. }
  1751. })
  1752. tempTip.setDuration(2000)
  1753. tempTip.setIndex(100)
  1754. tempTip.showSuccess('添加成功')
  1755. $("#batchStoreLogsModel").modal('hide')
  1756. } else {
  1757. tempTip.setIndex(100)
  1758. tempTip.show('添加失败' + response.data.fail_info)
  1759. }
  1760. }).catch(function (error) {
  1761. tempTip.setDuration(3000)
  1762. tempTip.show('处理结果添加异常:' + error)
  1763. })
  1764. },
  1765. batchOthers() {
  1766. let _this = this;
  1767. let data = {
  1768. orderIssueIds: this.checkData,
  1769. logistic_indemnity_money: this.edit.batchOthers.logistic_indemnity_money,
  1770. logistic_express_remission: this.edit.batchOthers.logistic_express_remission,
  1771. baoshi_indemnity_money: this.edit.batchOthers.baoshi_indemnity_money,
  1772. baoshi_express_remission: this.edit.batchOthers.baoshi_express_remission,
  1773. userWorkGroupIds: this.edit.batchOthers.userWorkGroupIds,
  1774. };
  1775. window.tempTip.postBasicRequest('{{url("apiLocal/order/issue/batchOthers")}}', data, res => {
  1776. if (_this.edit.batchOthers.logistic_indemnity_money) {
  1777. _this.orderIssuesEdit(_this.checkData, "logistic_indemnity_money", _this.edit.batchOthers.logistic_indemnity_money);
  1778. }
  1779. if (_this.edit.batchOthers.logistic_express_remission) {
  1780. _this.orderIssuesEdit(_this.checkData, "logistic_express_remission", _this.edit.batchOthers.logistic_express_remission);
  1781. }
  1782. if (_this.edit.batchOthers.baoshi_indemnity_money) {
  1783. _this.orderIssuesEdit(_this.checkData, "baoshi_indemnity_money", _this.edit.batchOthers.baoshi_indemnity_money);
  1784. }
  1785. if (_this.edit.batchOthers.baoshi_express_remission) {
  1786. _this.orderIssuesEdit(_this.checkData, "baoshi_express_remission", _this.edit.batchOthers.baoshi_express_remission);
  1787. }
  1788. return "批量修改完成";
  1789. });
  1790. },
  1791. editSecondClientNo(orderIssue, e) {
  1792. let value = $(e.target).val()
  1793. let data = {id: orderIssue.id, secondClientNo: value}
  1794. axios.post('{{url('apiLocal/order/issue/editSecondClientNo')}}', data).then(function (response) {
  1795. if (response.data.success) {
  1796. if (response.data.message) {
  1797. orderIssue.second_client_no = value
  1798. orderIssue.second_order = null;
  1799. tempTip.okWindow(response.data.message, '确认')
  1800. } else {
  1801. orderIssue.second_client_no = value
  1802. if (response.data.order === null) {
  1803. orderIssue.second_order = null;
  1804. } else {
  1805. orderIssue.second_order = response.data.order
  1806. }
  1807. tempTip.setDuration(2000)
  1808. tempTip.showSuccess('修改成功')
  1809. }
  1810. } else {
  1811. tempTip.setDuration(2000)
  1812. tempTip.show('修改失败:' + response.data.fail_info)
  1813. }
  1814. }).catch(function (error) {
  1815. tempTip.setDuration(3000)
  1816. tempTip.show('修改异常:' + error)
  1817. });
  1818. },
  1819. truncateText(e) {
  1820. let nowrapSpan = $(e.target);
  1821. nowrapSpan.hide();
  1822. nowrapSpan.siblings('.text-truncate').show();
  1823. },
  1824. nowrapText(e) {
  1825. let truncateSpan = $(e.target);
  1826. truncateSpan.hide();
  1827. truncateSpan.siblings('.text-nowrap').show();
  1828. },
  1829. addShow(id) {
  1830. this.edit.isShow.push(id)
  1831. },
  1832. removeShow(id) {
  1833. let index = this.edit.isShow.indexOf(id)
  1834. if (index !== -1) this.edit.isShow.splice(index, 1)
  1835. },
  1836. removeFocusing(e) {
  1837. $(e.target).parent('tr').removeClass('focusing')
  1838. },
  1839. addSecondLogisticNumber(orderIssue) {
  1840. let logisticNumber = $('#secondLogisticNumber-' + orderIssue.id).val()
  1841. let data = {
  1842. id: orderIssue.id,
  1843. logistic_number: logisticNumber,
  1844. client_code: orderIssue.second_client_no
  1845. }
  1846. let _this = this;
  1847. axios.post('{{url('apiLocal/order/issue/editSecondLogisticNumber')}}', data).then(function (response) {
  1848. if (response.data.success) {
  1849. tempTip.setDuration(2000)
  1850. tempTip.showSuccess('添加成功')
  1851. if (response.data.order != null) {
  1852. _this.regroupOrder(response.data.order);
  1853. orderIssue.second_order = response.data.order
  1854. orderIssue.second_client_no = response.data.order.client_code
  1855. } else orderIssue.second_logistic_number = logisticNumber;
  1856. if (response.data.second_logistic_number != null) {
  1857. orderIssue.second_logistic_number = response.data.second_logistic_number
  1858. }
  1859. _this.edit.orderIssue.id = ''
  1860. _this.edit.orderIssue.showId = ''
  1861. } else {
  1862. tempTip.setDuration(2000)
  1863. tempTip.show(response.data.fail_info)
  1864. }
  1865. }).catch(function (error) {
  1866. tempTip.setDuration(2000)
  1867. tempTip.show('添加失败' + error)
  1868. });
  1869. },
  1870. importdispose() {
  1871. let _this = this
  1872. if (this.checkData.length === 0) {
  1873. tempTip.setDuration(2000)
  1874. tempTip.show('没有勾选内容')
  1875. return;
  1876. }
  1877. if (!confirm('是否对当前导入进行处理')) return;
  1878. let data = {ids: this.checkData};
  1879. tempTip.setDuration(9999)
  1880. tempTip.setIndex(2000)
  1881. tempTip.waitingTip('正在处理,请等待')
  1882. axios.post('{{url('apiLocal/order/issue/disposeImport')}}', data).then(function (response) {
  1883. tempTip.cancelWaitingTip()
  1884. if (response.data.success) {
  1885. tempTip.setDuration(2000)
  1886. tempTip.showSuccess('处理导入成功')
  1887. _this.orderIssues.forEach(function (item) {
  1888. if (_this.checkData.includes(item.id)) {
  1889. item.imported_status = '导入已处理'
  1890. }
  1891. });
  1892. return;
  1893. }
  1894. tempTip.setDuration(2000)
  1895. tempTip.show(response.data.fail_info)
  1896. }).catch(function (error) {
  1897. tempTip.setDuration(2000)
  1898. tempTip.show('处理导入出现异常' + error)
  1899. })
  1900. },
  1901. financeConfirm(flag) {
  1902. let _this = this
  1903. if (this.checkData.length === 0) {
  1904. tempTip.setDuration(2000)
  1905. tempTip.show('没有勾选内容')
  1906. return;
  1907. }
  1908. if (flag === '是') {
  1909. if (!confirm('是否进行财务确认')) return;
  1910. } else {
  1911. if (!confirm('是否取消财务确认')) return;
  1912. }
  1913. let data = {ids: this.checkData};
  1914. tempTip.setDuration(9999);
  1915. tempTip.waitingTip('处理中.......');
  1916. data.flag = flag;
  1917. axios.post('{{url('apiLocal/order/issue/financeConfirm')}}', data)
  1918. .then(function (response) {
  1919. tempTip.cancelWaitingTip();
  1920. if (response.data.success) {
  1921. tempTip.setDuration(2000);
  1922. if (flag === '是') {
  1923. tempTip.showSuccess('确认成功');
  1924. } else {
  1925. tempTip.showSuccess('取消成功');
  1926. }
  1927. _this.orderIssuesEdit(data.ids, 'finance_confirm', '是');
  1928. return;
  1929. }
  1930. tempTip.setDuration(2000);
  1931. tempTip.show(response.data.error);
  1932. }).catch(function (error) {
  1933. tempTip.cancelWaitingTip();
  1934. tempTip.setDuration(2000);
  1935. tempTip.show(error);
  1936. });
  1937. },
  1938. orderIssuesEdit(ids, column, value) {
  1939. this.orderIssues.forEach(function (item) {
  1940. if (ids.includes(item.id)) {
  1941. item[column] = value;
  1942. }
  1943. });
  1944. },
  1945. archiveOrderIssue() {
  1946. if (this.checkData.length === 0) {
  1947. tempTip.show('没有勾选订单');
  1948. return;
  1949. }
  1950. let _this = this;
  1951. let ids = _this.checkData;
  1952. let data = {ids: ids};
  1953. axios.post('{{url('apiLocal/order/issue/archiveOrderIssue')}}', data)
  1954. .then(function (response) {
  1955. if (response.data.success) {
  1956. tempTip.setDuration(2000);
  1957. tempTip.showSuccess('确认成功');
  1958. _this.orderIssuesEdit(data.ids, 'final_status', '已归档');
  1959. return;
  1960. }
  1961. tempTip.setDuration(2000);
  1962. tempTip.show(response.data.error);
  1963. })
  1964. .catch(function (error) {
  1965. tempTip.cancelWaitingTip();
  1966. tempTip.setDuration(2000);
  1967. tempTip.show(error);
  1968. });
  1969. },
  1970. joinRejectedBill(orderIssue, e) {
  1971. let logistic_number = $(e.target).prev().val();
  1972. this
  1973. let is_return = false;
  1974. if (logistic_number === null) {
  1975. tempTip.show('请输入需要关联的退回单号');
  1976. is_return = true;
  1977. }
  1978. orderIssue.order_issue_rejected_bills.forEach(function (order_issue_rejected_bill) {
  1979. if (order_issue_rejected_bill.logistic_number_return === logistic_number) {
  1980. tempTip.show('已有对应的退回单号');
  1981. is_return = true;
  1982. }
  1983. });
  1984. if (is_return) return;
  1985. let _this = this;
  1986. axios.post('{{url('apiLocal/order/issue/rejectedBill/join')}}', {
  1987. id: orderIssue.id,
  1988. logistic_number_return: logistic_number
  1989. })
  1990. .then(function (response) {
  1991. if (response.data.success) {
  1992. tempTip.setDuration(2000);
  1993. tempTip.showSuccess('关联成功');
  1994. if (orderIssue.order_issue_rejected_bills === null) orderIssue.order_issue_rejected_bills = [];
  1995. orderIssue.order_issue_rejected_bills.push(response.data.data.orderIssueRejectedBill);
  1996. $(e.target).prev().val('');
  1997. if (response.data.data.orderIssue) {
  1998. orderIssue.is_new_rejecting = response.data.data.orderIssue.is_new_rejecting;
  1999. orderIssue.rejecting_status = response.data.data.orderIssue.rejecting_status;
  2000. }
  2001. _this.regroupRejectedBill(orderIssue);
  2002. _this.$forceUpdate();
  2003. return;
  2004. }
  2005. tempTip.setDuration(2000);
  2006. tempTip.show(response.data.error);
  2007. })
  2008. .catch(function (error) {
  2009. tempTip.setDuration(2000);
  2010. tempTip.show(error);
  2011. });
  2012. },
  2013. unJoinRejectedBill(orderIssue, logistic_number) {
  2014. if (logistic_number === null) return;
  2015. let _this = this;
  2016. axios.post('{{url('apiLocal/order/issue/rejectedBill/unJoin')}}', {
  2017. id: orderIssue.id,
  2018. logistic_number_return: logistic_number
  2019. })
  2020. .then(function (response) {
  2021. if (response.data.success) {
  2022. tempTip.setDuration(2000);
  2023. tempTip.showSuccess('退回单号取消关联成功');
  2024. if (orderIssue.order_issue_rejected_bills === null) return;
  2025. $.each(orderIssue.order_issue_rejected_bills, function (i, item) {
  2026. if (item && item.logistic_number_return === logistic_number) {
  2027. orderIssue.order_issue_rejected_bills.splice(i, 1);
  2028. _this.regroupRejectedBill(orderIssue);
  2029. }
  2030. });
  2031. if (response.data.orderIssue) {
  2032. orderIssue.rejecting_status = response.data.orderIssue.rejecting_status;
  2033. orderIssue.is_new_rejecting = response.data.orderIssue.is_new_rejecting;
  2034. }
  2035. _this.$forceUpdate();
  2036. return;
  2037. }
  2038. tempTip.setDuration(2000);
  2039. tempTip.show(response.data.error);
  2040. })
  2041. .catch(function (error) {
  2042. tempTip.cancelWaitingTip();
  2043. tempTip.setDuration(2000);
  2044. tempTip.show(error);
  2045. });
  2046. },
  2047. reviseJoinRejectedBill(orderIssue, logistic_number, e) {
  2048. let logistic_number_update = $(e.target).val();
  2049. if (logistic_number === null || logistic_number_update === null) {
  2050. tempTip.show('请输入需要关联的退回单号');
  2051. return;
  2052. }
  2053. let _this = this;
  2054. let data = {
  2055. id: orderIssue.id,
  2056. logistic_number_return: logistic_number,
  2057. logistic_number_return_update: logistic_number_update
  2058. };
  2059. axios.post('{{url('apiLocal/order/issue/rejectedBill/reviseJoin')}}', data)
  2060. .then(function (response) {
  2061. if (response.data.success) {
  2062. tempTip.setDuration(2000);
  2063. tempTip.showSuccess('修改关联');
  2064. if (response.data.data) {
  2065. $.each(orderIssue.rejected_bills, function (i, rejecetd_bill) {
  2066. if (rejecetd_bill.logistic_number_return === logistic_number) {
  2067. orderIssue.rejected_bills.splice(i, 1);
  2068. orderIssue.rejected_bills.push(response.data.data);
  2069. _this.regroupRejectedBill(orderIssue);
  2070. }
  2071. });
  2072. }
  2073. return;
  2074. }
  2075. tempTip.setDuration(2000);
  2076. tempTip.show(response.data.error);
  2077. })
  2078. .catch(function (error) {
  2079. tempTip.cancelWaitingTip();
  2080. tempTip.setDuration(2000);
  2081. tempTip.show(error);
  2082. });
  2083. },
  2084. addUserWorkgroup(orderIssue, user_workgroup_id, e) {
  2085. let value = $(e.target).val()
  2086. window.tempTip.postBasicRequest("{{url('apiLocal/order/issue/userWorkgroups/add')}}", {
  2087. orderIssueId: orderIssue.id,
  2088. userWorkgroupId: value
  2089. }, res => {
  2090. orderIssue.user_workgroups.unshift(res);
  2091. return "添加事故责任方成功!";
  2092. });
  2093. },
  2094. deleteUserWorkgroup(user_workgroup, index, orderIssue) {
  2095. window.tempTip.postBasicRequest("{{url('apiLocal/order/issue/userWorkgroups/delete')}}", {
  2096. orderIssueId: orderIssue.id,
  2097. userWorkgroupId: user_workgroup.id
  2098. }, res => {
  2099. orderIssue.user_workgroups.splice(index, 1);
  2100. this.$forceUpdate();
  2101. return "删除事故责任方成功!";
  2102. });
  2103. },
  2104. showUserWorkgroup(orderIssue) {
  2105. orderIssue.is_show_user_workgroup = !orderIssue.is_show_user_workgroup;
  2106. this.$forceUpdate();
  2107. },
  2108. destroySecondLogisticNumber(orderIssue) {
  2109. if (!confirm('确定要删除吗')) {
  2110. return;
  2111. }
  2112. tempTip.setDuration(2000)
  2113. axios.post('{{url("apiLocal/order/issue/destroySecondLogisticNumber")}}', {id: orderIssue.id}).then(res => {
  2114. if (res.data.success) {
  2115. tempTip.showSuccess("修改成功");
  2116. orderIssue.second_logistic_number = null;
  2117. return;
  2118. }
  2119. tempTip.show(res.data.error);
  2120. }).catch(error => {
  2121. tempTip.show("网络异常:" + error);
  2122. });
  2123. },
  2124. listenTBodyResize(){
  2125. this.$set(this,'toggleBtnHeight',document.getElementById('tbody').clientHeight);
  2126. },
  2127. tagLog(item){
  2128. let url = '{{route('order.issue.log.tagApi')}}';
  2129. let data = {id:item.id};
  2130. if(!confirm('是否标记当前记录客户不可见')) return;
  2131. window.axios.post(url,data).then(res=>{
  2132. if (res.data.success){
  2133. window.tempTip.showSuccess('标记成功');
  2134. item.tag = 1;
  2135. }else{
  2136. window.tempTip.show(res.data.message? res.data.message : '标记出现异常');
  2137. }
  2138. }).catch(err=>{
  2139. window.tempTip.show(err);
  2140. });
  2141. },
  2142. isDB(item){
  2143. let arr = [14,15,28,29,72,87,121];
  2144. if(arr.indexOf(item) >= 0) return true
  2145. return false;
  2146. }
  2147. },
  2148. filters:{
  2149. date:function(value) {
  2150. if (value !== null) {
  2151. return moment(value).format('yyyy-MM-DD');
  2152. }
  2153. return value
  2154. },
  2155. }
  2156. })
  2157. // modal 隐藏时修改 input 为空
  2158. $("#exampleModal").on('hide.bs.modal', function (e) {
  2159. $('#remark').val('');
  2160. });
  2161. </script>
  2162. @endsection