index.blade.php 127 KB

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