|
@@ -17,8 +17,8 @@
|
|
|
导出Excel
|
|
导出Excel
|
|
|
</button>
|
|
</button>
|
|
|
<div class="dropdown-menu">
|
|
<div class="dropdown-menu">
|
|
|
- <a class="dropdown-item" href="javascript:">导出勾选内容</a>
|
|
|
|
|
- <a class="dropdown-item" href="javascript:">导出所有页</a>
|
|
|
|
|
|
|
+ <a class="dropdown-item" @click="exportExcel('pitch')" href="javascript:">导出勾选内容</a>
|
|
|
|
|
+ <a class="dropdown-item" @click="exportExcel()" href="javascript:">导出所有页</a>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<button type="button" class="btn btn-sm tooltipTarget btn-outline-dark" @click="batchCancelPrint">取消打印标记</button>
|
|
<button type="button" class="btn btn-sm tooltipTarget btn-outline-dark" @click="batchCancelPrint">取消打印标记</button>
|
|
@@ -28,7 +28,7 @@
|
|
|
<tr class="text-nowrap">
|
|
<tr class="text-nowrap">
|
|
|
<th>
|
|
<th>
|
|
|
<label for="all">
|
|
<label for="all">
|
|
|
- <input type="checkbox" id="all" @click="checkAll($event)"/>
|
|
|
|
|
|
|
+ <input type="checkbox" id="all" @click="checkAll()"/>
|
|
|
</label>
|
|
</label>
|
|
|
</th>
|
|
</th>
|
|
|
<th>序号</th>
|
|
<th>序号</th>
|
|
@@ -51,7 +51,6 @@
|
|
|
<tr v-for="(wave,i) in waves">
|
|
<tr v-for="(wave,i) in waves">
|
|
|
<td>
|
|
<td>
|
|
|
<input class="checkItem" type="checkbox" :value="wave.waveNo" v-model="checkData">
|
|
<input class="checkItem" type="checkbox" :value="wave.waveNo" v-model="checkData">
|
|
|
-
|
|
|
|
|
</td>
|
|
</td>
|
|
|
<td>@{{ i+1 }}</td>{{--序号--}}
|
|
<td>@{{ i+1 }}</td>{{--序号--}}
|
|
|
<td class="text-dark font-weight-bold text-nowrap">@{{ wave.waveNo }}</td>{{--波次号--}}
|
|
<td class="text-dark font-weight-bold text-nowrap">@{{ wave.waveNo }}</td>{{--波次号--}}
|
|
@@ -67,13 +66,13 @@
|
|
|
<td class="text-muted">@{{ wave.expressPrintTime }}</td>{{--快递单号打时间--}}
|
|
<td class="text-muted">@{{ wave.expressPrintTime }}</td>{{--快递单号打时间--}}
|
|
|
@can("订单管理-波次-取消打印标记")
|
|
@can("订单管理-波次-取消打印标记")
|
|
|
<td class="text-center">
|
|
<td class="text-center">
|
|
|
- <button v-if="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>
|
|
|
|
|
|
|
+ <button v-if="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>
|
|
</td>
|
|
|
@endcan
|
|
@endcan
|
|
|
</tr>
|
|
</tr>
|
|
|
</table>
|
|
</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="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'" @if({{$param['currPage']}} < {{$param['pageTotal']}}) @endif>下一页</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"
|
|
<input @keyup.enter="pageTurning($event)" class="form-control-sm ml-3 tooltipTarget"
|
|
|
:placeholder="'当前页数:'+'{{$param['currPage']}}'+'/'+'{{$param['pageTotal']}}'" title="去往指定页">
|
|
:placeholder="'当前页数:'+'{{$param['currPage']}}'+'/'+'{{$param['pageTotal']}}'" title="去往指定页">
|
|
|
<span class="text-muted m-1">共 {{$param['count']}} 条 </span>
|
|
<span class="text-muted m-1">共 {{$param['count']}} 条 </span>
|
|
@@ -111,11 +110,11 @@
|
|
|
],
|
|
],
|
|
|
form: '',
|
|
form: '',
|
|
|
checkData: [],
|
|
checkData: [],
|
|
|
-
|
|
|
|
|
|
|
+ pageTotal:'{{$param['pageTotal']}}',
|
|
|
|
|
+ currPage:'{{$param['currPage']}}',
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
mounted: function () {
|
|
mounted: function () {
|
|
|
-
|
|
|
|
|
let data = [[
|
|
let data = [[
|
|
|
{name: 'start_time', type: 'dataTime', tip: '选择显示指定日期的起始时间', placeholder: ''},
|
|
{name: 'start_time', type: 'dataTime', tip: '选择显示指定日期的起始时间', placeholder: ''},
|
|
|
{name: 'end_time', type: 'dataTime', tip: '选择显示指定日期的结束时间', placeholder: ''},
|
|
{name: 'end_time', type: 'dataTime', tip: '选择显示指定日期的结束时间', placeholder: ''},
|
|
@@ -137,21 +136,24 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
batchCancelPrint: function () {
|
|
batchCancelPrint: function () {
|
|
|
- let ids = this.checkData;
|
|
|
|
|
- if (ids.length === 0) {
|
|
|
|
|
|
|
+ if (this.checkData === 0) {
|
|
|
tempTip.show('没有勾选记录');
|
|
tempTip.show('没有勾选记录');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ let ids = this.getCheckedIds();
|
|
|
this.cancelPrint(ids);
|
|
this.cancelPrint(ids);
|
|
|
},
|
|
},
|
|
|
cancelPrint: function (ids, type = 'string') {
|
|
cancelPrint: function (ids, type = 'string') {
|
|
|
let _this = this;
|
|
let _this = this;
|
|
|
|
|
+ // console.log(ids);
|
|
|
axios.post("{{url("wave/cancelPrinting")}}", {ids: ids}).then(function (res) {
|
|
axios.post("{{url("wave/cancelPrinting")}}", {ids: ids}).then(function (res) {
|
|
|
if (res.data.success) {
|
|
if (res.data.success) {
|
|
|
_this.waves.forEach(function (wave) {
|
|
_this.waves.forEach(function (wave) {
|
|
|
if (ids.includes(wave.waveNo)) {
|
|
if (ids.includes(wave.waveNo)) {
|
|
|
- wave.expressPicking = '';
|
|
|
|
|
- wave.expressPickTime = '';
|
|
|
|
|
|
|
+ console.log(wave.waveNo);
|
|
|
|
|
+ wave.expressPrinting = '';
|
|
|
|
|
+ wave.expressPrintTime = '';
|
|
|
|
|
+ wave.UdfPrintFlag2 = 'N';
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
tempTip.setDuration(3000);
|
|
tempTip.setDuration(3000);
|
|
@@ -159,6 +161,7 @@
|
|
|
if (type === 'array') {
|
|
if (type === 'array') {
|
|
|
_this.checkData = [];
|
|
_this.checkData = [];
|
|
|
}
|
|
}
|
|
|
|
|
+ $(".checkItem").prop("checked",false);
|
|
|
} else {
|
|
} else {
|
|
|
tempTip.setDuration(2500);
|
|
tempTip.setDuration(2500);
|
|
|
tempTip.show('标记勾选内容取消打印失败,错误:' + response.data.fail_info);
|
|
tempTip.show('标记勾选内容取消打印失败,错误:' + response.data.fail_info);
|
|
@@ -167,7 +170,6 @@
|
|
|
tempTip.setDuration(4000);
|
|
tempTip.setDuration(4000);
|
|
|
tempTip.show('网络错误:' + err);
|
|
tempTip.show('网络错误:' + err);
|
|
|
});
|
|
});
|
|
|
- console.log(this.waves);
|
|
|
|
|
},
|
|
},
|
|
|
pageTurning: function (event) {
|
|
pageTurning: function (event) {
|
|
|
let page = $(event.target).val();
|
|
let page = $(event.target).val();
|
|
@@ -181,6 +183,78 @@
|
|
|
},
|
|
},
|
|
|
nextPage() {
|
|
nextPage() {
|
|
|
window.location = this.form.nextPage();
|
|
window.location = this.form.nextPage();
|
|
|
|
|
+ },
|
|
|
|
|
+ exportExcel(string = 'all'){
|
|
|
|
|
+ // let data = this.getSearch();
|
|
|
|
|
+ let search = '';
|
|
|
|
|
+ if(string === "all"){
|
|
|
|
|
+ }else if(string === 'pitch'){
|
|
|
|
|
+ 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('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;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|