index.blade.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. @extends('layouts.app')
  2. @section('title')退货管理@endsection
  3. @section('content')
  4. <div id="nav2">
  5. @component('rejected.menu')@endcomponent
  6. </div>
  7. <div class="container-fluid">
  8. <div style="min-width: 2070px;">
  9. <div class="d-none" id="list">
  10. @if(Session::has('successTip'))
  11. <div class="alert alert-success h1">{{Session::get('successTip')}}</div>
  12. @endif
  13. <div class="col-12" style="background: #fff;">
  14. <div class="row">
  15. <div class="col" v-if="isBeingFilterConditions">
  16. <label for="">
  17. <a :href="'{{url('rejected').'?paginate='}}'+filterParams.paginate"><span class="btn btn-warning text-dark">清除过滤条件</span></a>
  18. </label>
  19. </div>
  20. <table class="table table-sm table-bordered m-0">
  21. <tr>
  22. <td colspan="9">
  23. <select name="" id="setPaginate" class="tooltipTarget form-control-sm" style="vertical-align: middle"
  24. @change="setPaginate" v-model="filterParams.paginate">
  25. <option value="50">每页显示50条</option>
  26. <option value="100">每页显示100条</option>
  27. <option value="200">每页显示200条</option>
  28. <option value="500">每页显示500条</option>
  29. <option value="1000">每页显示1000条</option>
  30. </select>
  31. </td>
  32. </tr>
  33. <tr>
  34. <td colspan="2">
  35. <input type="date" name="created_at_start" class="form-control-sm tooltipTarget" style="width:140px"
  36. :class="filterParams.created_at_start?'bg-warning':''" v-model="filterParams.created_at_start"
  37. @keypress="created_at_startEntering" @change="created_at_startChange" title="选择显示指定日期的起始时间">
  38. </td>
  39. <td>
  40. <input type="text" class="form-control-sm tooltipTarget" placeholder="客户"
  41. style="width:70px" @input="locateOwner" @keypress="owner_idEntering"
  42. title="客户:输入关键词快速定位下拉列表,回车确定">
  43. <select name="owner_id" id="owner_id" class="form-control-sm tooltipTarget"
  44. :class="filterParams.owner_id?'bg-warning':''" v-model="filterParams.owner_id"
  45. title="选择要显示的客户" @change="owner_idChange">
  46. <option value="" selected>全部客户</option>
  47. <option v-for="owner in owners" :value="owner.id">@{{ owner.name }}</option>
  48. </select>
  49. </td>
  50. <td>
  51. <input type="text" class="form-control-sm tooltipTarget" placeholder="订单号" name="order_number"
  52. :class="filterParams.order_number?'bg-warning':''" v-model="filterParams.order_number"
  53. @input="order_numberEntering" @keypress="submitFilterOnEnter" title="订单号:15天以内的支持模糊搜索,回车提交">
  54. </td>
  55. <td>
  56. <input type="text" class="form-control-sm tooltipTarget" placeholder="退回单号" name="logistic_number_return"
  57. :class="filterParams.logistic_number_return?'bg-warning':''"
  58. @input="logistic_number_returnEntering" @keypress="submitFilterOnEnter" title="退回单号:支持查找多个以逗号或空格分隔的单号,15天以内的支持模糊搜索,回车提交">
  59. </td>
  60. <td>
  61. <input type="text" class="form-control-sm tooltipTarget" placeholder="原单单号" name="logistic_number"
  62. :class="filterParams.logistic_number?'bg-warning':''"
  63. @input="logistic_numberEntering" @keypress="submitFilterOnEnter" title="原单单号:15天以内的支持模糊搜索,回车提交">
  64. </td>
  65. <td>
  66. <select name="is_checked" class="form-control-sm tooltipTarget" @change="is_checkedChange" title="审核"
  67. :class="filterParams.is_checked?'bg-warning':''">
  68. <option value="">是否审核</option>
  69. <option value="1">已审核</option>
  70. <option value="0">未审核</option>
  71. </select>
  72. </td>
  73. <td width="36%"></td>
  74. </tr>
  75. <tr>
  76. <td colspan="2">
  77. <input type="date" name="created_at_end" class="form-control-sm tooltipTarget" style="width:140px"
  78. :class="filterParams.created_at_end?'bg-warning':''"
  79. @keypress="created_at_endEntering" @change="created_at_endChange" title="选择显示指定日期的结束时间">
  80. </td>
  81. <td>
  82. <input type="text" class="form-control-sm tooltipTarget" placeholder="商品条码" name="barcode_goods"
  83. :class="filterParams.barcode_goods?'bg-warning':''" title="商品条码:可模糊匹配右边未填完的部分,按回车提交"
  84. @input="barcode_goodsEntering" @keypress="submitFilterOnEnter">
  85. </td>
  86. <td>
  87. <select name="id_quality_label" id="id_quality_label" class="form-control-sm tooltipTarget"
  88. :class="filterParams.id_quality_label?'bg-warning':''"
  89. title="是否正品:正品仅显示全部是正品的退单,但残次显示的是包含有残次的退单" @change="id_quality_labelChange">
  90. <option value="" selected>是否正品</option>
  91. <option v-for="qualityLabel in qualityLabels" :value="qualityLabel.id">@{{ qualityLabel.name }}</option>
  92. </select>
  93. </td>
  94. <td>
  95. <input type="text" class="form-control-sm tooltipTarget" name="mobile_sender" placeholder="寄件人手机"
  96. :class="filterParams.mobile_sender?'bg-warning':''"
  97. @input="mobile_senderEntering" @keypress="submitFilterOnEnter" title="寄件人手机:输入完成敲回车提交">
  98. </td>
  99. <td>
  100. <input type="text" class="form-control-sm tooltipTarget" name="checked_numbers" placeholder="审核批次号"
  101. :class="filterParams.checked_numbers?'bg-warning':''"
  102. @input="checked_numbersEntering" @keypress="submitFilterOnEnter" title="审核批次号:支持右位留空的模糊搜索">
  103. </td>
  104. <td>
  105. <select name="is_loaded" id="is_loaded" class="form-control-sm"
  106. :class="filterParams.is_loaded?'bg-warning':''"
  107. title="是否入库" @change="is_loadedChange">
  108. <option value="" selected>是否入库</option>
  109. <option value="1">是</option>
  110. <option value="0">否</option>
  111. <option value="null">无需入库</option>
  112. <option value="2">待推单</option>
  113. <option value="4">待确认</option>
  114. </select>
  115. </td>
  116. <td><input type="button" class="btn btn-outline-dark btn-sm" @click="searchByFilters" value="按条件搜索"/></td>
  117. </tr>
  118. <tr>
  119. <td colspan="9">
  120. @can('退货管理-审核')
  121. <span class="btn btn-sm" @click="checkAll" style="cursor: pointer"
  122. :class="[rejectedBills_checkBoxes.length>0?'btn-dark':'btn-outline-dark']">审核</span>
  123. @endcan
  124. @can('退货管理-编辑')
  125. <span class="btn btn-sm" @click="finishAll" style="cursor: pointer"
  126. :class="[rejectedBills_checkBoxes.length>0?'btn-dark':'btn-outline-dark']">完结</span>
  127. @endcan
  128. {{-- <select name="" class="tooltipTarget form-control-sm" style="vertical-align: middle"--}}
  129. {{-- @change="exportExcel" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出"--}}
  130. {{-- :class="[rejectedBills_checkBoxes.length>0?'btn-dark':'btn-outline-dark']">--}}
  131. {{-- <option value="">导出Excel</option>--}}
  132. {{-- <option value="1">导出勾选内容</option>--}}
  133. {{-- <option value="2">导出所有页</option>--}}
  134. {{-- </select>--}}
  135. <span class="dropdown">
  136. <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget":class="[rejectedBills_checkBoxes.length>0?'btn-dark text-light':'']"
  137. data-toggle="dropdown" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出">
  138. 导出Excel
  139. </button>
  140. <div class="dropdown-menu">
  141. <a class="dropdown-item" @click="exportExcel(1)" href="javascript:">导出勾选内容</a>
  142. <a class="dropdown-item" @click="exportExcel(2)" href="javascript:">导出所有页</a>
  143. </div>
  144. </span>
  145. @can('退货管理-编辑')
  146. {{-- <select name="" class="tooltipTarget form-control-sm" style="vertical-align: middle"--}}
  147. {{-- title="将勾选记录的入库状态设定为是或否,仅对未完结状态的记录有效" @change="setIsLoaded_batch"--}}
  148. {{-- :class="[rejectedBills_checkBoxes.length>0?'btn-dark':'btn-outline-dark']">--}}
  149. {{-- <option value="">修改入库</option>--}}
  150. {{-- <option value="1">设定为是</option>--}}
  151. {{-- <option value="0">设定为否</option>--}}
  152. {{-- <option value="null">无需入库</option>--}}
  153. {{-- <option value="2">待推单</option>--}}
  154. {{-- </select>--}}
  155. <span class="dropdown">
  156. <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget":class="[rejectedBills_checkBoxes.length>0?'btn-dark text-light':'']"
  157. data-toggle="dropdown" title="将勾选记录的入库状态设定为是或否,仅对未完结状态的记录有效">
  158. 修改入库
  159. </button>
  160. <div class="dropdown-menu">
  161. <a class="dropdown-item" @click="setIsLoaded_batch(1)" href="javascript:">设定为是</a>
  162. <a class="dropdown-item" @click="setIsLoaded_batch(0)" href="javascript:">设定为否</a>
  163. <a class="dropdown-item" @click="setIsLoaded_batch('null')" href="javascript:">无需入库</a>
  164. <a class="dropdown-item" @click="setIsLoaded_batch(2)" href="javascript:">待推单</a>
  165. <a class="dropdown-item" @click="setIsLoaded_batch(4)" href="javascript:">待确认</a>
  166. </div>
  167. </span>
  168. @endcan
  169. </td>
  170. </tr>
  171. </table>
  172. </div>
  173. </div>
  174. <table class="table table-striped table-sm table-bordered table-hover" style="background: #fff;">
  175. <tr>
  176. <th>
  177. <input type="checkbox" class="form-control-sm tooltipTarget" title="全选"
  178. id="checkSelectingAll" @click="checkBoxAllToggle" v-model="checkBoxAll" value="1">
  179. </th>
  180. <th>序号</th>
  181. <th>是否审核</th>
  182. <th>是否完结</th>
  183. <th>是否入库</th>
  184. <th>创建时间</th>
  185. <th>客户名称</th>
  186. <th>退回单号</th>
  187. <th>退回公司</th>
  188. <th>订单号</th>
  189. <th>姓名</th>
  190. <th>电话</th>
  191. <th>原单单号</th>
  192. <th>到付费用</th>
  193. <th>商品总数</th>
  194. <th>商品条码</th>
  195. <th>商品名称</th>
  196. <th>数量</th>
  197. <th>是否正品</th>
  198. <th>批次号</th>
  199. <th>生产日期</th>
  200. <th>效期</th>
  201. <th>备注</th>
  202. <th>退单备注</th>
  203. <th>录入人</th>
  204. @can('退货管理-编辑','退货管理-删除')
  205. <th>操作</th>
  206. @endcan
  207. </tr>
  208. <tr v-for="(rejectedBill,i) in rejectedBills" :data-id="rejectedBill.id">
  209. <td>
  210. <input type="checkbox" v-model="rejectedBills_checkBoxes" :value="rejectedBill.id"/>
  211. </td>
  212. <td class="text-muted" style="opacity:0.7">
  213. @{{ i+1 }}
  214. </td>
  215. <td class="text-muted">
  216. <span v-if="rejectedBill.is_checked==1" class="text-success">
  217. <span class="fa fa-check-square"></span> @{{ rejectedBill.checked_numbers }}
  218. </span>
  219. <span v-else>
  220. 未审核
  221. </span>
  222. </td>
  223. <td class="" :class="[rejectedBill.is_finished!=0?'text-success':'text-muted']">@{{rejectedBill.is_finished | yesNo}}</td>
  224. <td class="" :class="[rejectedBill.is_loaded==1?'text-success':'text-muted']">
  225. <span v-if="rejectedBill.is_loaded==4">
  226. <button class="btn btn-sm btn-info" @click="confirmBeStored($event,rejectedBill.id)">确定入库</button>
  227. </span>
  228. <span v-else>@{{rejectedBill.is_loaded | yesNoIsLoaded}}</span>
  229. </td>
  230. <td class="text-muted">@{{rejectedBill.created_at}}</td>
  231. <td>@{{rejectedBill.owner.name}}</td>
  232. <td>@{{rejectedBill.logistic_number_return}}</td>
  233. <td class="text-muted">@{{rejectedBill.logistic.name}}</td>
  234. <td>@{{rejectedBill.order_number}}</td>
  235. <td class="text-muted">@{{rejectedBill.sender}}</td>
  236. <td class="text-muted">@{{rejectedBill.mobile_sender}}</td>
  237. <td>@{{rejectedBill.logistic_number}}</td>
  238. <td class="text-muted">@{{rejectedBill.fee_collected}}</td>
  239. <td class="text-muted">@{{rejectedBill.goods_amount}}</td>
  240. <td colspan="8">
  241. <div class="text-center" v-if="rejectedBill.detailFolding && rejectedBill.items.length>1">
  242. <a href="javascript:;" @click="rejectedBill.detailFolding=false">@{{rejectedBill.goods_amount}}件商品,点击展开明细</a></div>
  243. <table class="table table-sm" v-else>
  244. <tr v-for="item in rejectedBill.items">
  245. <td style="width: 140px">@{{item.barcode_goods}}</td>
  246. <td style="width: 140px">@{{item.name_goods}}</td>
  247. <td style="width: 30px">@{{item.amount}}</td>
  248. <td class="text-muted">@{{item.quality_label}}</td>
  249. <td class="text-muted">@{{item.batch_number}}</td>
  250. <td class="text-muted">@{{item.made_at}}</td>
  251. <td class="text-muted">@{{item.validity_at}}</td>
  252. <td class="text-muted">@{{item.remark}}</td>
  253. </tr>
  254. <tr v-if="!rejectedBill.detailFolding && rejectedBill.items.length>1">
  255. <td colspan="8" class="text-center">
  256. <a href="javascript:;" @click="rejectedBill.detailFolding=true">点击收起明细</a>
  257. </td>
  258. </tr>
  259. </table>
  260. </td>
  261. <td class="text-muted" style="max-width: 190px">@{{rejectedBill.remark}}</td>
  262. <td class="text-muted">@{{rejectedBill.operator_name}}</td>
  263. @can('退货管理-编辑')
  264. <td>
  265. <span v-if="rejectedBill.is_finished==0">
  266. @can('退货管理-编辑')
  267. <button class="btn btn-outline-info btn-sm tooltipTarget" @click="edit">改</button>
  268. @endcan
  269. @can('退货管理-删除')
  270. <button
  271. class="btn btn-outline-danger btn-sm tooltipTarget" @click="destroy(rejectedBill)">删</button>
  272. @endcan
  273. </span>
  274. <span v-else class="text-muted">已完结</span>
  275. </td>
  276. @endcan
  277. </tr>
  278. </table>
  279. <div class="text-info h5 btn btn">{{$rejectedBills->count()}}/{{$rejectedBills->total()}}</div>
  280. {{$rejectedBills->appends($paginateParams)->links()}}
  281. </div>
  282. </div>
  283. </div>
  284. @endsection
  285. @section('lastScript')
  286. <script>
  287. let rejectedBills=[
  288. @foreach( $rejectedBills as $rejectedBill )
  289. {
  290. id:'{{$rejectedBill->id}}',is_checked:'{{$rejectedBill->is_checked}}',checked_numbers:'{{$rejectedBill->checked_numbers}}',
  291. created_at:'{{$rejectedBill->created_at->format("Y-m-d H:i")}}',owner:{!! $rejectedBill->owner !!},
  292. order_number:'{{$rejectedBill->order_number}}',sender:'{{$rejectedBill->sender}}',
  293. mobile_sender:'{{$rejectedBill->mobile_sender}}',logistic_number:'{{$rejectedBill->logistic_number}}',
  294. logistic_number_return:'{{$rejectedBill->logistic_number_return}}',logistic:{!!$rejectedBill->logistic!!},
  295. fee_collected:'{{$rejectedBill->fee_collected}}',goods_amount:'{{$rejectedBill->goods_amount}}',
  296. is_loaded:'{{$rejectedBill->is_loaded_null}}',operator_name:'{{$rejectedBill->operator_name}}',detailFolding:true,
  297. items:{!! $rejectedBill->items !!},is_finished:'{{$rejectedBill->is_finished}}',remark:'{{$rejectedBill->remark}}'
  298. },
  299. @endforeach
  300. ];
  301. let owners=[
  302. @foreach($owners as $owner)
  303. {id:'{{$owner->id}}',name:'{{$owner->name}}'},
  304. @endforeach
  305. ];
  306. let qualityLabels=[
  307. @foreach($qualityLabels as $qualityLabel)
  308. {id:'{{$qualityLabel->id}}',name:'{{$qualityLabel->name}}'},
  309. @endforeach
  310. ];
  311. @if(isset($paginateParams))
  312. let paginateParams={!! json_encode($paginateParams) !!};
  313. @endif
  314. let total='{{$rejectedBills->total()}}';
  315. let editUrl = "{{url('rejectedBill')}}/";
  316. let destroyUrl = "{{url('rejectedBill')}}/";
  317. let ajaxConfirmBeStoredUrl = '{{url("apiLocal/rejectedBill/apiConfirmBeStored")}}';
  318. let ajaxCheckUrl = '{{url("apiLocal/rejectedBill/apiSetIsLoadedAll")}}';
  319. let ajaxCheckAllURL = '{{url("rejected/ajaxCheckAll")}}';
  320. let ajaxFinishAllUrl='{{url("rejected/ajaxFinishAll")}}';
  321. let exportExcelURL = '{{url("rejected/exportExcel")}}';
  322. let exportExcelOnFilterParamsURL='{{url("rejected/exportExcelOnFilterParams")}}';
  323. let csrfInput='@csrf';
  324. </script>
  325. <script src="{{asset('js/singles/rejectedIndex200513.js')}}"></script>
  326. @endsection