| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278 |
- @extends('layouts.app')
- @section('title')订单管理-波次@endsection
- @section("content")
- @component("order.wave.menu")@endcomponent
- <div class="container-fluid d-none" id="wave_div">
- <div style="min-width: 2000px;">
- <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 ">
- <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>--}}
- </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">
- <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.waveStatus !== '99' && 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>
- </div>
- @endsection
- @section("lastScript")
- <script type="text/javascript" src="{{asset('js/queryForm/queryForm200818a.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']}}',
- },
- 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: {
- 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;
- // console.log(ids);
- 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)) {
- console.log(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('标记勾选内容重置打印失败,错误:' + response.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);
- console.log(search,url);
- window.open("{{url('oder/wave/exportExcel?')}}"+search+url);
- // todo
- /* let instance = axios.create({
- {{--url:'{{url("wave/exportExcel")}}',--}}
- responseType:'blob',
- data:data,
- });
- instance.post().then(function(res){
- let blob = res.data;
- let url = URL.createObjectURL(blob);
- let fileName = new Date().toLocaleDateString() + "--波次记录.xml";
- let a = document.createElement('a');
- $("body").append($(a).attr("href",url).attr("download",fileName)) ;
- a.click();
- a.remove()
- }).catch(function(err){
- console.log("err",err);
- });*/
- },
- 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;
- }
- }
- });
- </script>
- @endsection
|