general.blade.php 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. @extends('layouts.app')
  2. @section('title')退货管理@endsection
  3. @section('content')
  4. <div id="nav2">
  5. @component('rejected.menu')@endcomponent
  6. @component('rejected.search.menu')@endcomponent
  7. </div>
  8. <div class="container-fluid">
  9. <div>
  10. {{-- <div style="min-width: 2070px;">--}}
  11. <div class="d-none" id="list">
  12. @if(Session::has('successTip'))
  13. <div class="alert alert-success h1">{{Session::get('successTip')}}</div>
  14. @endif <div id="form_div"></div>
  15. <span class="dropdown">
  16. <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget":class="[rejectedBills_checkBoxes.length>0?'btn-dark text-light':'']"
  17. data-toggle="dropdown" title="导出所有页将会以搜索条件得到的筛选结果,将其全部记录(每一页)导出">
  18. 导出Excel
  19. </button>
  20. <div class="dropdown-menu">
  21. <a class="dropdown-item" @click="exportExcel(false)" href="javascript:">导出勾选内容</a>
  22. <a class="dropdown-item" @click="exportExcel(true)" href="javascript:">导出所有页</a>
  23. </div>
  24. </span>
  25. @can('退货管理-编辑')
  26. {{-- <select name="" class="tooltipTarget form-control-sm" style="vertical-align: middle"--}}
  27. {{-- title="将勾选记录的入库状态设定为是或否,仅对未完结状态的记录有效" @change="setIsLoaded_batch"--}}
  28. {{-- :class="[rejectedBills_checkBoxes.length>0?'btn-dark':'btn-outline-dark']">--}}
  29. {{-- <option value="">修改入库</option>--}}
  30. {{-- <option value="1">设定为是</option>--}}
  31. {{-- <option value="0">设定为否</option>--}}
  32. {{-- <option value="null">无需入库</option>--}}
  33. {{-- <option value="2">待推单</option>--}}
  34. {{-- </select>--}}
  35. @endcan
  36. @can('退货管理-审核')
  37. <span class="btn btn-sm" @click="checkAll" style="cursor: pointer"
  38. :class="[rejectedBills_checkBoxes.length>0?'btn-dark':'btn-outline-dark']">审核</span>
  39. @endcan
  40. @can('退货管理-编辑')
  41. <span class="btn btn-sm" @click="finishAll" style="cursor: pointer"
  42. :class="[rejectedBills_checkBoxes.length>0?'btn-dark':'btn-outline-dark']">完结</span>
  43. @endcan
  44. <span class="dropdown">
  45. <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget":class="[rejectedBills_checkBoxes.length>0?'btn-dark text-light':'']"
  46. data-toggle="dropdown" title="将勾选记录的入库状态设定为是或否,仅对未完结状态的记录有效">
  47. 修改入库
  48. </button>
  49. <div class="dropdown-menu">
  50. <a class="dropdown-item" @click="setIsLoaded_batch(1)" href="javascript:">设定为是</a>
  51. <a class="dropdown-item" @click="setIsLoaded_batch(0)" href="javascript:">设定为否</a>
  52. <a class="dropdown-item" @click="setIsLoaded_batch('null')" href="javascript:">无需入库</a>
  53. <a class="dropdown-item" @click="setIsLoaded_batch(2)" href="javascript:">待推单</a>
  54. <a class="dropdown-item" @click="setIsLoaded_batch(4)" href="javascript:">待确认</a>
  55. </div>
  56. </span>
  57. @can('退货管理-编辑')
  58. <a class="btn btn-sm btn-outline-dark" href="{{url('rejected/importRejectedNumber')}}" style="cursor: pointer">导入修改</a>
  59. @endcan
  60. <button class="btn btn-sm ml-2 btn-primary" v-if="rejectedBills_checkBoxes.length>0" @click="copyLogisticNumber()">复制快递单号</button>
  61. <span for="checkSelectingAll" class="d-none" id="cloneCheckAll">
  62. <input type="checkbox" class="form-control-sm tooltipTarget" title="全选"
  63. id="checkSelectingAll" @click="checkBoxAllToggle($event)">
  64. </span>
  65. <table class="table table-striped table-sm table-bordered table-hover text-nowrap d-none" id="headerRoll" ></table>
  66. <table class="table table-striped table-sm table-bordered table-hover text-nowrap" style="background: #fff;" id="headerParent">
  67. <tr id="header"></tr>
  68. <tr v-for="(rejectedBill,i) in rejectedBills" :data-id="rejectedBill.id">
  69. <td>
  70. <input type="checkbox" v-model="rejectedBills_checkBoxes" :value="rejectedBill.id"/>
  71. </td>
  72. <td class="text-nowrap">
  73. {{-- <span class="text-muted" style="opacity:0.7">@{{ i+1 }}</span> <span v-if="issueIds.includes(rejectedBill.id)" class="badge badge-pill badge-danger">问题件</span>--}}
  74. <span class="text-muted" style="opacity:0.7">@{{ i+1 }}</span> <span v-if="rejectedBill.order_issue" class="badge badge-pill badge-danger">问题件</span>
  75. </td>
  76. <td class="text-muted">
  77. <span v-if="rejectedBill.is_checked==1" class="text-success">
  78. <span class="fa fa-check-square"></span> @{{ rejectedBill.checked_numbers }}
  79. </span>
  80. <span v-else>
  81. 未审核
  82. </span>
  83. </td>
  84. <td class="" :class="[rejectedBill.is_finished==1?'text-success':'text-muted']">@{{rejectedBill.is_finished | yesNo}}</td>
  85. <td class="" :class="[rejectedBill.is_loaded==1?'text-success':'text-muted']">
  86. <span v-if="rejectedBill.is_loaded==4">
  87. <button class="btn btn-sm btn-info" @click="confirmBeStored($event,rejectedBill.id)">确定入库</button>
  88. </span>
  89. <span v-else>@{{rejectedBill.is_loaded | yesNoIsLoaded}}</span>
  90. </td>
  91. <td class="text-muted">@{{rejectedBill.created_at}}</td>
  92. <td><span v-if="rejectedBill.owner">@{{rejectedBill.owner.name}}</span></td>
  93. <td>@{{rejectedBill.logistic_number_return}}</td>
  94. <td class="text-muted"><span v-if="rejectedBill.logistic">@{{rejectedBill.logistic.name}}</span></td>
  95. <td>@{{rejectedBill.order_number}}</td>
  96. <td class="text-muted">@{{rejectedBill.sender}}</td>
  97. <td class="text-muted">@{{rejectedBill.mobile_sender}}</td>
  98. <td>@{{rejectedBill.logistic_number}}</td>
  99. @cannot('退货管理-到付费用')<td class="text-muted">@{{rejectedBill.fee_collected}}</td>@endcannot
  100. @can('退货管理-查询-客户定义-爱奇艺')<td class="text-muted">@{{rejectedBill.common_01}}</td>@endcan
  101. <td class="text-muted">@{{rejectedBill.common_02}}</td>
  102. <td class="text-muted">@{{rejectedBill.goods_amount}}</td>
  103. <td colspan="8">
  104. <div class="text-center" v-if="rejectedBill.detailFolding && rejectedBill.items.length>1">
  105. <a href="javascript:;" @click="rejectedBill.detailFolding=false">@{{rejectedBill.goods_amount}}件商品,点击展开明细</a></div>
  106. <table class="table table-sm" v-else>
  107. <tr v-for="item in rejectedBill.items">
  108. <td style="width: 140px">@{{item.barcode_goods}}</td>
  109. <td style="width: 140px">@{{item.name_goods}}</td>
  110. <td style="width: 30px">@{{item.amount}}</td>
  111. <td class="text-muted">@{{item.quality_label}}</td>
  112. <td class="text-muted">@{{item.batch_number}}</td>
  113. <td class="text-muted">@{{item.made_at}}</td>
  114. <td class="text-muted">@{{item.validity_at}}</td>
  115. <td class="text-muted">@{{item.remark}}</td>
  116. </tr>
  117. <tr v-if="!rejectedBill.detailFolding && rejectedBill.items.length>1">
  118. <td colspan="8" class="text-center">
  119. <a href="javascript:;" @click="rejectedBill.detailFolding=true">点击收起明细</a>
  120. </td>
  121. </tr>
  122. </table>
  123. </td>
  124. {{-- <td class="text-muted" style="max-width: 190px">@{{rejectedBill.remark}}</td>--}}
  125. <td style="min-width:150px;">
  126. @can('退货管理-编辑备注')
  127. <textarea class="form-control form-control-sm" :rows="rejectedBill.remark?Math.ceil(rejectedBill.remark.length/8):2" cols=8
  128. @change="updateRejectedBillRemark($event)" :value="rejectedBill.remark" :data_id="rejectedBill.id">@{{ rejectedBill.remark }}</textarea>
  129. @else
  130. <span>@{{rejectedBill.remark}}</span>
  131. @endcan
  132. </td>
  133. <td class="text-muted">@{{rejectedBill.operator_name}}</td>
  134. @can('退货管理-编辑')
  135. <td>
  136. <span v-if="rejectedBill.is_finished!=1">
  137. @can('退货管理-编辑')
  138. <button class="btn btn-outline-info btn-sm tooltipTarget" @click="edit(rejectedBill.id)">改</button>
  139. @endcan
  140. @can('退货管理-删除')
  141. <button
  142. class="btn btn-outline-danger btn-sm tooltipTarget" @click="destroy(rejectedBill)">删</button>
  143. @endcan
  144. </span>
  145. <span v-else class="text-muted">已完结</span>
  146. </td>
  147. @endcan
  148. </tr>
  149. </table>
  150. <div class="text-info h5 btn btn">{{$rejectedBills->count()}}/{{$rejectedBills->total()}}</div>
  151. {{$rejectedBills->appends($paginateParams)->links()}}
  152. </div>
  153. <label><textarea id="clipboardDiv" style="opacity:0"></textarea></label>
  154. </div>
  155. </div>
  156. @endsection
  157. @section('lastScript')
  158. <script>
  159. let rejectedBills={!! $rejectedBills->toJson()!!}.data;
  160. rejectedBills.forEach(function(rejectedBill){
  161. rejectedBill.detailFolding=true;
  162. })
  163. let owners=[
  164. @foreach($owners as $owner)
  165. {id:'{{$owner->id}}',name:'{{$owner->name}}'},
  166. @endforeach
  167. ];
  168. let logistics=[
  169. @foreach($logistics as $logistic)
  170. {!! $logistic !!},
  171. @endforeach
  172. ];
  173. let qualityLabels=[
  174. @foreach($qualityLabels as $qualityLabel)
  175. {id:'{{$qualityLabel->id}}',name:'{{$qualityLabel->name}}'},
  176. @endforeach
  177. ];
  178. @if(isset($paginateParams))
  179. let paginateParams={!! json_encode($paginateParams) !!};
  180. @endif
  181. let total='{{$rejectedBills->total()}}';
  182. let editUrl = "{{url('rejectedBill')}}/";
  183. let destroyUrl = "{{url('rejectedBill')}}/";
  184. let ajaxConfirmBeStoredUrl = '{{url("apiLocal/rejectedBill/apiConfirmBeStored")}}';
  185. let ajaxCheckUrl = '{{url("apiLocal/rejectedBill/apiSetIsLoadedAll")}}';
  186. let ajaxCheckAllURL = '{{url("rejected/ajaxCheckAll")}}';
  187. let ajaxFinishAllUrl='{{url("rejected/ajaxFinishAll")}}';
  188. let csrfInput='@csrf';
  189. </script>
  190. <script src="{{mix('js/queryForm/export.js')}}"></script>
  191. <script src="{{mix('js/queryForm/queryForm.js')}}"></script>
  192. <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>
  193. <script>
  194. let vue = new Vue({
  195. el:"#list",
  196. data:{
  197. rejectedBills:rejectedBills,
  198. rejectedBills_checkBoxes:[],
  199. owners:[
  200. @foreach($owners as $owner)
  201. {name:'{{$owner->id}}',value:'{{$owner->name}}'},
  202. @endforeach
  203. ],
  204. {{--issueIds:{!! $issueIds !!},--}}
  205. logistics:[
  206. @foreach($logistics as $logistic)
  207. {name:'{{$logistic->id}}',value:'{{$logistic->name}}'},
  208. @endforeach
  209. ],
  210. qualityLabels:[
  211. @foreach($qualityLabels as $qualityLabel)
  212. {name:'{{$qualityLabel->id}}',value:'{{$qualityLabel->name}}'},
  213. @endforeach
  214. ],
  215. },
  216. mounted:function(){
  217. $(".tooltipTarget").tooltip({'trigger':'hover'});
  218. $('#list').removeClass('d-none');
  219. let data=[
  220. [
  221. {name:'created_at_start',type:'dateTime',tip:'选择显示指定日期的起始时间'},
  222. {name:'owner_id',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的客户'],
  223. placeholder:['货主','定位或多选货主'],data:this.owners},
  224. {name:'order_number',type:'input',tip:'客户单号:可在两侧增加百分号(%)进行模糊搜索',placeholder:'客户单号'},
  225. {name:'logistic_number_return',type:'input',tip:'退回单号:可在两侧增加百分号(%)进行模糊搜索',placeholder:'退回单号'},
  226. {name:'logistic_number',type:'input',tip:'原单单号:可在两侧增加百分号(%)进行模糊搜索',placeholder:'原单单号'},
  227. {name:'is_checked',type:'select',placeholder: '是否审核',data:[{name:1,value:'已审核'},{name:0,value:'未审核'}]},
  228. {name:'id_logistic_return',type:'select',placeholder: '快递名称',data:this.logistics},
  229. {name:'remark',type:'input',tip:'退单备注:默认查询15天以内记录信息',placeholder: '退单备注'},
  230. ],[
  231. {name:'created_at_end',type:'dateTime',tip:'选择显示指定日期的结束时间'},
  232. {name:'barcode_goods',type:'input',tip:'商品条码:可模糊匹配右边未填完的部分,按回车提交',placeholder:'商品条码'},
  233. {name:'id_quality_label',type:'select',tip:'是否正品:正品仅显示全部是正品的退单,但残次显示的是包含有残次的退单',placeholder: '是否正品',data:this.qualityLabels},
  234. {name:'mobile_sender',type:'input',tip:'寄件人手机:输入完成敲回车提交',placeholder:'寄件人手机'},
  235. {name:'checked_numbers',type:'input',tip:'审核批次号:支持右位留空的模糊搜索',placeholder:'审核批次号'},
  236. {name:'is_loaded',type:'select',placeholder: '是否入库',data:[{name:1,value:'是'},{name:0,value:'否'},
  237. {name:'null',value:'无需入库'},{name:2,value:'待推单'},{name:4,value:'待确认'},{name:3,value:'交互异常'}]},
  238. {name:'is_issue',type:'select',data:[{name:'true',value:'有'},{name:'false',value:'无'}],tip:'问题件',placeholder:'问题件'}
  239. ]
  240. ];
  241. this.form=new query({
  242. el:"#form_div",
  243. condition:data
  244. });
  245. this.form.init();
  246. let _this = this;
  247. let column = [
  248. {name:'cloneCheckAll',customization:true,type:'checkAll',column:'id',
  249. dom:$('#cloneCheckAll').removeClass('d-none'), neglect: true},
  250. {name:'index',value: '序号', neglect: true},
  251. {name:'checked_numbers',value: '是否审核', neglect: true},
  252. {name: 'is_finished', value: '是否完结',neglect: true},
  253. {name: 'is_loaded', value: '是否入库', neglect: true},
  254. {name:'created_at',value: '创建时间'},
  255. {name: 'owner_name', value: '客户名称', neglect: true},
  256. {name: 'logistic_number_return', value: '退回单号'},
  257. {name: 'logistic_name', value: '退回公司', neglect: true},
  258. {name:'order_number',value: '订单号'},
  259. {name: 'sender', value: '姓名'},
  260. {name: 'mobile_sender', value: '电话'},
  261. {name: 'logistic_number', value: '原单单号'},
  262. @cannot('退货管理-到付费用'){name:'fee_collected',value: '到付费用',neglect: true},@endcannot
  263. @can('退货管理-查询-客户定义-爱奇艺'){name:'common_01',value: '寄件方省'},@endcan
  264. {name:'common_02',value: '重量'},
  265. {name:'goods_amount',value: '商品总数'},
  266. {name:'item_barcode_goods',value: '商品条码', neglect: true},
  267. {name: 'item_name_goods', value: '商品名称', neglect: true},
  268. {name: 'item_amount', value: '数量', neglect: true},
  269. {name:'item_quality_label',value: '是否正品', neglect: true},
  270. {name:'item_batch_number',value: '批次号', neglect: true},
  271. {name:'item_made_at',value: '生产日期', neglect: true},
  272. {name:'item_validity_at',value: '效期', neglect: true},
  273. {name:'item_remark',value: '备注', neglect: true},
  274. {name:'remark',value: '退单备注'},
  275. {name:'operator_name',value: '录入人'},
  276. @can('退货管理-编辑','退货管理-删除'){name:'remove',value: '操作', neglect: true},@endcan
  277. ];
  278. setTimeout(function () {
  279. let header = new Header({
  280. el: "#header",
  281. column: column,
  282. data: _this.rejectedBills,
  283. restorationColumn: 'id',
  284. fixedTop:($('#form_div').height())+2,
  285. offset:0.5,
  286. vue:vue,
  287. checkbox : 'rejectedBills_checkBoxes',
  288. });
  289. header.init();
  290. },0);
  291. },
  292. watch:{
  293. rejectedBills_checkBoxes:{
  294. handler(){
  295. if (this.rejectedBills_checkBoxes.length === this.rejectedBills.length){
  296. document.querySelector('#checkSelectingAll').checked = true;
  297. document.querySelector('#checkSelectingAll_temp').checked = true;
  298. }else {
  299. document.querySelector('#checkSelectingAll').checked = false;
  300. document.querySelector('#checkSelectingAll_temp').checked = false;
  301. }
  302. },
  303. deep:true
  304. }
  305. },
  306. methods:{
  307. copyLogisticNumber(){
  308. let text="";
  309. this.rejectedBills_checkBoxes.forEach((id,i)=>{
  310. this.rejectedBills.some(bill=>{
  311. if (bill.id == id){
  312. text += bill.logistic_number_return;
  313. if (i!==this.rejectedBills_checkBoxes.length-1)text += "\r\n";
  314. return true;
  315. }
  316. });
  317. });
  318. this.copyText(text)
  319. },
  320. copyText(text){
  321. try {
  322. $('#clipboardDiv').text(text).select().focus();
  323. document.execCommand("Copy");
  324. tempTip.setIndex(1052)
  325. tempTip.setDuration(2000)
  326. tempTip.showSuccess('复制成功')
  327. } catch (e) {
  328. tempTip.setIndex(1052)
  329. tempTip.setDuration(2000)
  330. tempTip.showSuccess('复制失败:'+e)
  331. }
  332. },
  333. updateRejectedBillRemark:function (e) {
  334. let target = $(e.target);
  335. let _this = this;
  336. let id = target.attr('data_id');
  337. let remark = target.val();
  338. let ajaxUrl= '{{url("rejected/changeRejectedBillRemark")}}';
  339. axios.post(ajaxUrl,{'id':id,'remark':remark}).then(function (response) {
  340. if(response.data.success){
  341. _this.updateRejectedBills(id,remark);
  342. tempTip.setDuration(2000);
  343. tempTip.showSuccess('备注修改成功');
  344. }else{
  345. tempTip.setDuration(3000);
  346. tempTip.show('备注修改失败!'+response.data.fail_info);
  347. }
  348. }).catch(function (err) {
  349. tempTip.setDuration(3000);
  350. tempTip.show('备注修改失败!网络异常:'+err);
  351. });
  352. },
  353. // 更新表格数据
  354. updateRejectedBills(id,remark){
  355. this.rejectedBills.some(function(rejectedBill){
  356. if(parseInt(rejectedBill.id) === parseInt(id)){
  357. rejectedBill.remark = remark;
  358. return true;
  359. }
  360. })
  361. },
  362. edit(id){
  363. window.location.href=editUrl+id+"/edit";
  364. // window.open(editUrl+id+"/edit",'_blank') ;
  365. },
  366. destroy:function(rejectedBill){
  367. if(!confirm('确定要删除退货信息“' + rejectedBill.owner.name+':'+rejectedBill.logistic_number_return+ '”吗?')){return;}
  368. let data=this;
  369. let url = destroyUrl+rejectedBill.id;
  370. axios.delete(url,{id:rejectedBill.id})
  371. .then(function (response) {
  372. if(response.data.success){
  373. for (let i = 0; i < data.rejectedBills.length; i++) {
  374. if (data.rejectedBills[i].id===rejectedBill.id){
  375. data.rejectedBills.splice(i,1);
  376. break;
  377. }
  378. }
  379. tempTip.setDuration(1000);
  380. tempTip.showSuccess('删除退货信息"'+rejectedBill.owner.name+':'+rejectedBill.logistic_number_return+'"成功!')
  381. }else{
  382. tempTip.setDuration(1000);
  383. tempTip.show('删除退货信息"'+rejectedBill.owner.name+':'+rejectedBill.logistic_number_return+'"失败!')
  384. }
  385. })
  386. .catch(function (err) {
  387. tempTip.setDuration(3000);
  388. tempTip.show('删除退货信息失败!'+'网络错误:' + err);
  389. });
  390. },
  391. cancelCheckConfirmAll:function(){
  392. $('#checkConfirmingAll').tooltip('hide');
  393. setTimeout(function () {
  394. $(".tooltipTarget").tooltip({'trigger':'hover'})
  395. }, 10);
  396. this.rejectedBills.forEach(function(rejectedBill){
  397. if(rejectedBill.is_checked===-1)
  398. rejectedBill.is_checked='0';
  399. })
  400. },
  401. setIsLoaded_batch:function(val){
  402. let _this=this;
  403. if(_this.rejectedBills_checkBoxes.length===0){
  404. tempTip.show('没有勾选记录');
  405. $(e.target).val("");
  406. return;
  407. }
  408. let is_loaded=0;
  409. let is_loadedLabel='否';
  410. if(parseInt(val)===1){
  411. is_loaded=1;
  412. is_loadedLabel='是';
  413. }else if(parseInt(val)===2){
  414. is_loaded=2;
  415. is_loadedLabel='待推单';
  416. }else if(parseInt(val)===4){
  417. is_loaded=4;
  418. is_loadedLabel='待确认';
  419. }else if(val==="null"){
  420. is_loaded='null';
  421. is_loadedLabel='无需入库';
  422. }
  423. if(!confirm("确定要标记所有勾选入库情况为'"+is_loadedLabel+"'吗")){return;}
  424. axios.post(ajaxCheckUrl,{ids:_this.rejectedBills_checkBoxes,is_loaded:is_loaded}).then(function(response){
  425. if(response.data.success){
  426. _this.rejectedBills_checkBoxes.forEach(function(id){
  427. _this.rejectedBills.forEach(function(bill){
  428. if(bill.id===id){
  429. bill.is_loaded=is_loaded;
  430. }
  431. });
  432. });
  433. tempTip.setDuration(1000);
  434. tempTip.showSuccess('修改勾选记录的入库状态成功');
  435. }else{
  436. tempTip.setDuration(2500);
  437. tempTip.show('修改勾选记录的入库状态失败,错误:'+response.data.fail_info);
  438. }
  439. }).catch(function (e) {
  440. alert('网络连接错误:'+e);
  441. tempTip.setDuration(2500);
  442. tempTip.show('审核勾选内容失败,网络连接错误:'+e);
  443. });
  444. $(e.target).val("")
  445. },
  446. checkBoxAllToggle:function(e){
  447. if (e.target.checked) {
  448. this.rejectedBills.forEach((el) => {
  449. if (!el.id) this.rejectedBills_checkBoxes.push(el.id);
  450. if (el.id && this.rejectedBills_checkBoxes.indexOf(el.id) == '-1') {
  451. this.rejectedBills_checkBoxes.push(el.id);
  452. }
  453. });
  454. } else {
  455. this.rejectedBills_checkBoxes = [];
  456. }
  457. },
  458. checkAll:function(){
  459. let _this=this;
  460. if(_this.rejectedBills_checkBoxes.length===0){
  461. tempTip.show('没有勾选记录');
  462. return
  463. }
  464. if(!confirm("确定要标记所有勾选内容为'已审核'吗")){return;}
  465. axios.post(ajaxCheckAllURL,{ids:_this.rejectedBills_checkBoxes}).then(function(response){
  466. if(response.data.success){
  467. response.data.rejecteds.forEach(function (rejected) {
  468. _this.rejectedBills.forEach(function(rejectedBill){
  469. if(parseInt(rejectedBill.id)===parseInt(rejected.id)){
  470. rejectedBill.is_checked=1;
  471. rejectedBill.checked_numbers=rejected.checked_numbers;
  472. }
  473. });
  474. });
  475. tempTip.setDuration(1000);
  476. tempTip.showSuccess('审核勾选内容成功');
  477. }else{
  478. tempTip.setDuration(2500);
  479. tempTip.show('审核勾选内容失败,错误:'+response.data.fail_info);
  480. }
  481. }).catch(function (e) {
  482. alert('网络连接错误:'+e);
  483. tempTip.setDuration(2500);
  484. tempTip.show('审核勾选内容失败,网络连接错误:'+e);
  485. })
  486. },
  487. confirmBeStored:function($e,id){
  488. let _this=this;
  489. axios.post(ajaxConfirmBeStoredUrl,{id:id}).then(function(response){
  490. if(response.data.success){
  491. _this.rejectedBills.forEach(function(rejectedBill){
  492. if(rejectedBill.id===id){
  493. rejectedBill.is_loaded=1;
  494. }
  495. });
  496. tempTip.setDuration(1000);
  497. tempTip.showSuccess('确认入库成功');
  498. }else{
  499. tempTip.setDuration(2500);
  500. tempTip.okWindow('数据异常无法确认!请在WMS确定入库状态后,勾选该条目手动修改相应入库状态!','知道了')
  501. }
  502. }).catch(function (e) {
  503. alert('确认失败,网络连接错误:'+e);
  504. tempTip.setDuration(2500);
  505. tempTip.show('确认失败,网络连接错误:'+e);
  506. })
  507. },
  508. finishAll:function(){
  509. let _this=this;
  510. if(_this.rejectedBills_checkBoxes.length===0){
  511. tempTip.show('没有勾选记录');
  512. return
  513. }
  514. if(!confirm("确定要标记所有勾选内容为'已完结'吗")){return;}
  515. axios.post(ajaxFinishAllUrl,{ids:_this.rejectedBills_checkBoxes}).then(function(response){
  516. if(response.data.success){
  517. _this.rejectedBills.forEach(function(rejectedBill){
  518. _this.rejectedBills_checkBoxes.forEach(function (checkedId) {
  519. if(rejectedBill.id===checkedId){
  520. rejectedBill.is_finished=1;
  521. }
  522. });
  523. });
  524. tempTip.setDuration(1000);
  525. tempTip.showSuccess('标记勾选内容为完结成功');
  526. }else{
  527. tempTip.setDuration(2500);
  528. tempTip.show('标记勾选内容为完结失败,错误:'+response.data.fail_info);
  529. }
  530. }).catch(function (e) {
  531. alert('网络连接错误:'+e);
  532. tempTip.setDuration(2500);
  533. tempTip.show('标记勾选内容完结失败,网络连接错误:'+e);
  534. })
  535. },
  536. exportExcel:function(checkAllSign){
  537. let url = '{{url('rejected/export')}}';
  538. let token='{{ csrf_token() }}';
  539. excelExport(checkAllSign,this.rejectedBills_checkBoxes,url,total,token);
  540. },
  541. },
  542. filters:{
  543. yesNo:function (val) {
  544. if(!val||val===0||val==='0'){return '否'}
  545. return '是'
  546. },
  547. yesNoIsLoaded:function (val) {
  548. switch(val){
  549. case 0:case '0':return '否';
  550. case 1:case '1':return '是';
  551. case 2:case '2':return '待推单';
  552. case 3:case '3':return '交互异常';
  553. case 4:case '4':return '待确认';
  554. case null:case 'null':return '无需入库';
  555. }
  556. return '';
  557. }
  558. }
  559. });
  560. </script>
  561. @endsection