|
|
@@ -22,12 +22,20 @@
|
|
|
<a class="dropdown-item" @click="dischargeTaskExport(true)" href="javascript:">导出所有页</a>
|
|
|
</div>
|
|
|
</span>
|
|
|
+
|
|
|
<span class="ml-1">
|
|
|
@can('人事管理-卸货-创建')
|
|
|
<button type="button" class="btn btn-outline-dark btn-sm form-control-sm tooltipTarget" @click="showCreateTaskModal(true)" style="background: #dad7e8;">创建任务</button>
|
|
|
@endcan
|
|
|
</span>
|
|
|
+
|
|
|
+ <span class="ml-1">
|
|
|
+ <button type="button" class="btn btn-outline-primary btn-sm form-control-sm tooltipTarget"
|
|
|
+ @click="importModal"
|
|
|
+ >批量导入</button>
|
|
|
+ </span>
|
|
|
</div>
|
|
|
+ @include('personnel.discharge.task._import')
|
|
|
@include('personnel.discharge.task._table')
|
|
|
@can('人事管理-卸货-创建')
|
|
|
@include('personnel.discharge.task._createTask')
|
|
|
@@ -54,6 +62,7 @@
|
|
|
addTask: {income_at:null},
|
|
|
executingTack: {},
|
|
|
taskError:{},
|
|
|
+ uploadError:[],
|
|
|
taskTypes: [
|
|
|
{name: 0, value: "装车"},
|
|
|
{name: 1, value: "卸车"},
|
|
|
@@ -353,8 +362,34 @@
|
|
|
},
|
|
|
showReceipt(task){
|
|
|
window.open(this.getReceiptUrl(task.id));
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 文件上传
|
|
|
+ importDischarge(){
|
|
|
+ window.tempTip.setIndex(1999);
|
|
|
|
|
|
+ let formData = new FormData();
|
|
|
+ let file = document.querySelector('#importFile').file[0];
|
|
|
+ if(file==null){
|
|
|
+ window.tempTip.show('请选择上传文件');
|
|
|
+ }
|
|
|
+ formData.append('file',file);
|
|
|
+ let url = '{{url('apiLocal/personnel/discharge/import')}}';
|
|
|
+ window.axios.post(url,formData,{
|
|
|
+ 'Content-Type': 'multipart/form-data'
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.data.success){
|
|
|
+ window.tempTip.showSuccess(res.data.message ? res.data.message : '导入成功!刷新页面显示');
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ window.tempTip.show('导入失败!'+(res.data.message ? res.data.message : ''));
|
|
|
+ }).catch(err=>{
|
|
|
+ window.tempTip.show(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ importModal(){
|
|
|
+ document.querySelector('#importFile').file = [];
|
|
|
+ $('#importModal').modal('show');
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
})
|