index.blade.php 141 KB

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