index.blade.php 126 KB

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