index.blade.php 24 KB

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