index.blade.php 125 KB

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