index.blade.php 124 KB

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