| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350 |
- @extends('layouts.app')
- @section('title')波次-订单管理@endsection
- @section("content")
- <div class="container-fluid d-none" id="wave_div">
- <div style="min-width: 2000px;">
- <div class="modal fade" tabindex="-1" role="dialog" id="myModal">
- <div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- </div>
- <div class="modal-body">
- <label class="w-100">
- <textarea class="form-control" placeholder="波次号:逗号(,)间隔" v-model="batchCodes"></textarea>
- </label>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-success" @click="repairBatch()" data-dismiss="modal">开始修复</button>
- </div>
- </div>
- </div>
- </div>
- <div id="form_div" style="min-width: 1950px;" class="bg-white"></div>
- <table class="table table-sm table-striped table-bordered table-hover card-body mt-2 " id="headerParent">
- <tr></tr>
- <tr>
- <td colspan="20">
- <button type="button" class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget" :class="[checkData.length>0?'btn-dark text-light':'']"
- data-toggle="dropdown" title="导出所有页将会以搜索条件得到的筛选结果,将其全部记录(每一页)导出">
- 导出Excel
- </button>
- <div class="dropdown-menu">
- <a class="dropdown-item" @click="exportExcel('pitch')" href="javascript:">导出勾选内容</a>
- <a class="dropdown-item" @click="exportExcel()" href="javascript:">导出所有页</a>
- </div>
- {{-- <button type="button" class="btn btn-sm tooltipTarget btn-outline-dark" @click="batchCancelPrint">重置打印标记</button>--}}
- <button type="button" class="btn btn-sm btn-outline-success" data-toggle="modal" data-target="#myModal">修复波次</button>
- <button type="button" class="btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#splitBatch">分割波次</button>
- <button type="button" class="btn btn-sm btn-outline-primary" @click="exePrint()">打印子波条码</button>
- </td>
- </tr>
- <tr class="text-nowrap">
- <th>
- <label for="all">
- <input type="checkbox" id="all" @click="checkAll()"/>
- </label>
- </th>
- <th>序号</th>
- <th>波次号</th>
- <th>波次状态</th>
- <th>波次规则</th>
- <th>波次描述</th>
- <th>承运人</th>
- <th>操作员</th>
- <th>创建时间</th>
- <th>拣货单打印人</th>
- <th>拣货单打印于</th>
- <th>快递单打印人</th>
- <th>快递单打印于</th>
- @can("订单管理-波次-重置打印")
- <th>重置打印</th>
- @endcan
- </tr>
- <tr v-for="(wave,i) in waves" @click="selectTr===i+1?selectTr=0:selectTr=i+1" :class="selectTr===i+1?'focusing' : ''">
- <td>
- <input class="checkItem" type="checkbox" :value="wave.waveNo" v-model="checkData">
- </td>
- <td>@{{ i+1 }}</td>{{--序号--}}
- <td class="text-dark font-weight-bold text-nowrap">@{{ wave.waveNo }}</td>{{--波次号--}}
- <td class="text-muted text-nowrap">@{{ wave.codename_c }}</td>{{--波次状态--}}
- <td class="text-nowrap text-muted">@{{ wave.waveRule }}</td>{{--波次规则--}}
- <td class="text-nowrap">@{{ wave.descr }}</td>{{--波次描述--}}
- <td class="text-muted">@{{ wave.descr_c }}</td>{{--承运人--}}
- <td class="text-nowrap">@{{ wave.addWho }}</td>{{--操作员--}}
- <td class="text-muted">@{{ wave.addTime }}</td>{{--创建时间--}}
- <td class="text-nowrap">@{{ wave.pickerPrint }}</td>{{--拣货单打印人--}}
- <td class="text-muted">@{{ wave.pickerPrintTime }}</td>{{--拣货单打印时间--}}
- <td class="text-nowrap">@{{ wave.expressPrinting }}</td>{{--快递单号打印人--}}
- <td class="text-muted">@{{ wave.expressPrintTime }}</td>{{--快递单号打时间--}}
- @can("订单管理-波次-重置打印")
- <td class="text-center">
- <button :disabled="!( wave.UdfPrintFlag2 === 'Y')" type="button" class="btn btn-sm btn-outline-dark text-nowrap" :data-value="wave.waveNo" @click="singleCancelPrint($event)">重置</button>
- </td>
- @endcan
- </tr>
- </table>
- <button type="button" class="btn btn-sm " @click="pervPage" :class="'{{$param['currPage']}}'> 1? 'btn-outline-info ':'disabled'" {{--disabled="'{{$param['currPage']}}'> 1?'':true"--}}>上一页</button>
- <button type="button" class="btn btn-sm " @click="nextPage" :class="'{{$param['currPage']}}'<'{{$param['pageTotal']}}'?'btn-outline-info':'disabled'" :disabled="currPage == pageTotal">下一页</button>
- <input @keyup.enter="pageTurning($event)" class="form-control-sm ml-3 tooltipTarget"
- :placeholder="'当前页数:'+'{{$param['currPage']}}'+'/'+'{{$param['pageTotal']}}'" title="去往指定页">
- <span class="text-muted m-1">共 {{$param['count']}} 条 </span>
- </div>
- @include("order.wave._split")
- @include("order.wave._printBody")
- </div>
- @endsection
- @section("lastScript")
- <script type="text/javascript" src="{{mix('js/utilities/barcode.js')}}"></script>
- <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
- <script>
- let vueList = new Vue({
- el: "#wave_div",
- data: {
- waves: [
- @foreach($waves as $wave)
- {
- waveNo: '{{$wave->waveno}}',
- waveStatus: '{{$wave->wavestatus}}',
- codename_c: '{{$wave->codename_c}}',
- descr: '{{$wave->descr}}',
- descr_c: '{{$wave->descr_c}}',
- addTime: '{{$wave->addtime}}',
- addWho: '{{$wave->addwho}}',
- waveRule: '{{$wave->waverule}}',
- waveDispatchId: '{{$wave->wavedispatchid}}',
- userDefine1: '{{$wave->userdefine1}}',
- userDefine2: '{{$wave->userdefine2}}',
- pickerPrint: '{{$wave->pickerPrint}}',
- pickerPrintTime: '{{$wave->pickerPrintTime}}',
- expressPrinting: '{{$wave->expressPrinting}}',
- expressPrintTime: '{{$wave->expressPrintTime}}',
- UdfPrintFlag2:'{{$wave->udfprintflag2}}'
- },
- @endforeach
- ],
- form: '',
- checkData: [],
- pageTotal:'{{$param['pageTotal']}}',
- currPage:'{{$param['currPage']}}',
- selectTr:'',
- batchCodes:"",
- splitSize:"",
- batchNumber:"",
- infoShow:false,
- splitGroupBySize:{},
- },
- mounted: function () {
- $('#wave_div').removeClass('d-none')
- let data = [[
- {name: 'start_time', type: 'dateTime', tip: '选择显示指定日期的起始时间', placeholder: ''},
- {name: 'end_time', type: 'dateTime', tip: '选择显示指定日期的结束时间', placeholder: ''},
- {name: 'wave_num', type: 'input', tip: '波次编号:如模糊搜索需要在条件前后输入%号,回车提交', placeholder: '波次编号'},
- ]];
- this.form = new query({
- el: '#form_div',
- condition: data,
- });
- this.form.init();
- $(".tooltipTarget").tooltip({'trigger': 'hover'});
- },
- methods: {
- repairBatch(){
- if (!this.batchCodes) return;
- window.tempTip.postBasicRequest("{{url('order/wave/repairBatch')}}",{"codes":this.batchCodes.split(",")},res=>{
- return res;
- },true);
- },
- singleCancelPrint: function ($event) {
- let ids = $($event.target).attr("data-value");
- if (ids) {
- this.cancelPrint(ids);
- }
- },
- batchCancelPrint: function () {
- if (this.checkData === 0) {
- tempTip.show('没有勾选记录');
- return;
- }
- let ids = this.getCheckedIds();
- this.cancelPrint(ids);
- },
- cancelPrint: function (ids, type = 'string') {
- let _this = this;
- tempTip.setDuration(99999)
- tempTip.waitingTip('取消中,请稍候')
- axios.post("{{url("order/wave/cancelPrinting")}}", {ids: ids}).then(function (res) {
- tempTip.setDuration(5000)
- tempTip.cancelWaitingTip();
- if (res.data.success) {
- _this.waves.forEach(function (wave) {
- if (ids.includes(wave.waveNo)) {
- wave.expressPrinting = '';
- wave.expressPrintTime = '';
- wave.UdfPrintFlag2 = 'N';
- }
- })
- tempTip.setDuration(3000);
- tempTip.showSuccess('重置打印成功!');
- if (type === 'array') {
- _this.checkData = [];
- }
- $(".checkItem").prop("checked",false);
- } else {
- tempTip.setDuration(2500);
- tempTip.show('标记勾选内容重置打印失败,错误:' + res.data.fail_info);
- }
- }).catch(function (err) {
- tempTip.setDuration(4000);
- tempTip.show('网络错误:' + err);
- });
- },
- pageTurning: function (event) {
- let page = $(event.target).val();
- if (!page) {
- return;
- }
- window.location = this.form.goPage(page);
- },
- pervPage() {
- window.location = this.form.pervPage();
- },
- nextPage() {
- window.location = this.form.nextPage();
- },
- exportExcel(string = 'all'){
- // let data = this.getSearch();
- let search = '';
- if(string === "all"){
- }else if(string === 'pitch'){
- if(this.getCheckedIds().length === 0){
- tempTip.show('没有勾选记录');
- return;
- }
- if(this.checkData){
- let seachs =this.checkData.map(function (value) {
- return "'"+value+"'";
- })
- search = "wave_num="+this.checkData.join(',');
- }
- }
- let url = window.location.search ;
- url = url.length< 2 ? '' : url.substring(1);
- window.open("{{url('order/wave/exportExcel?')}}"+search+url);
- },
- getSearch(){
- let search = window.location.search,data = {};
- if(!search || search.length <=1 ){
- return {};
- }
- let index =search.indexOf("?");
- search = (search.substr(index)).split('&');
- search.forEach(function(map){
- let arr = map.split('=');
- let key = arr[0],value = arr[2];
- if(value.include(',')){
- value = value.split(',');
- }
- data[key] = value;
- });
- return data;
- },
- checkAll(){
- let checked = $("#all").is(":checked");
- $(".checkItem").prop("checked",checked === true);
- if(checked){
- this.checkData = this.getCheckedIds();
- }else{
- this.checkData = [];
- }
- },
- getCheckedIds(){
- // HACK
- let values = [];
- let items = $(".checkItem:checked");
- let len = items.length,index =0;
- for (index =0;index <len;index++ ){
- values.push($(items[index]).val());
- }
- return values;
- },
- selectedColor(waveNo){
- if(waveNo === this.selectedWaveNo){
- this.selectedWaveNo = '';
- return;
- }
- this.selectedWaveNo = waveNo;
- },
- splitBatch(){
- window.tempTip.setDuration(2000);
- window.tempTip.setIndex(999);
- if (this.checkData.length<1){
- window.tempTip.show("未选中记录行");
- return;
- }
- if (!this.splitSize && !this.batchNumber){
- window.tempTip.show("未输入分割大小");
- return;
- }
- window.tempTip.postBasicRequest("{{url('order/wave/split')}}",{codes:this.checkData,split:this.splitSize,number:this.batchNumber},res=>{
- $("#splitBatch").modal('hide');
- return "分割成功";
- },true)
- },
- exePrint(){
- window.tempTip.setDuration(2000);
- if (this.checkData.length<1){
- window.tempTip.show("未选中记录行");
- return;
- }
- window.tempTip.postBasicRequest("{{url('order/wave/printChild')}}",{codes:this.checkData},res=>{
- this.splitGroupBySize = res;
- setTimeout(()=>{
- for(let key in this.splitGroupBySize){
- for (let i=1;i<=this.splitGroupBySize[key];i++){
- window.setBarcode(key+'-'+i, "#"+key+"-"+i, 2, 50, true)
- }
- }
- },10);
- setTimeout(()=>{
- exe();
- },50);
- })
- let exe = ()=>{
- let iframe=document.getElementById("print-iframe");
- this.infoShow=true;
- if(!iframe){
- iframe = document.createElement('IFRAME');
- iframe.setAttribute("id", "print-iframe");
- iframe.setAttribute('style', 'position:absolute;width:0;height:0;left:-500px;top:-500px;');
- document.body.appendChild(iframe);
- }else iframe.contentWindow.document.getElementById("iframe-content").remove();
- let doc = iframe.contentWindow.document;
- let el = document.getElementById("printContent");
- doc.write('<LINK rel="stylesheet" type="text/css" href="{{ asset(mix("css/app.css")) }}">');
- doc.write('<div id="iframe-content">' + el.innerHTML + '</div>');
- doc.close();
- iframe.contentWindow.focus();
- this.infoShow=false;
- setTimeout(function () {
- iframe.contentWindow.print();
- if (navigator.userAgent.indexOf("MSIE") > 0){
- document.body.removeChild(iframe);
- }
- },200);
- };
- },
- }
- });
- </script>
- @endsection
|