index.blade.php 124 KB

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