index.blade.php 24 KB

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