You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
130 lines
5.0 KiB
130 lines
5.0 KiB
const signed_overdue_date_data = () => {
|
|
return {
|
|
init() {
|
|
this.$watch('data.department_id', () => {
|
|
this.changeDepartment()
|
|
})
|
|
this.$watch('data.per', () => {
|
|
this.changeDetailsTable()
|
|
})
|
|
this.$watch('data.now_page', () => {
|
|
this.changeDetailsTable()
|
|
})
|
|
}, data: {
|
|
system_name_options: [{
|
|
text: '全部',
|
|
value: ''
|
|
}, {
|
|
text: 'BPM',
|
|
value: 'bpm'
|
|
}, {
|
|
text: 'WMS',
|
|
value: 'wms'
|
|
}],
|
|
deparetment_options: deparetment_options,
|
|
signDetails: signDetails,
|
|
user_options: user_options,
|
|
system_name: '',
|
|
department_id: '',
|
|
user_id: '',
|
|
now_page: now_page,
|
|
end_page: end_page,
|
|
per: 10,
|
|
search: search,
|
|
all_count: all_count,
|
|
},
|
|
table_details: [],
|
|
searchLoading: false,
|
|
downloadLoading: false,
|
|
search() {
|
|
this.ssearchLoading = true;
|
|
const form = new FormData();
|
|
form.append('system_name', this.data.system_name);
|
|
form.append('department_id', this.data.department_id);
|
|
form.append('user_id', this.data.user_id);
|
|
form.append('search', this.data.search);
|
|
form.append('method', 'getSingDetailsAllCount');
|
|
axios.post('./api/getSingedDetails.php', form).then(res => {
|
|
this.data.all_count = res.data;
|
|
this.data.end_page = Math.ceil(this.data.all_count / this.data.per);
|
|
}).catch(error => {
|
|
console.log(error.response.data)
|
|
this.searchLoading = false
|
|
})
|
|
|
|
form.append('method', 'getSingDetails');
|
|
axios.post('./api/getSingedDetails.php', form).then(res => {
|
|
this.data.signDetails = res.data;
|
|
this.searchLoading = false;
|
|
}).catch(error => {
|
|
console.log(error.response.data)
|
|
this.searchLoading = false
|
|
})
|
|
}, getDepartment() {
|
|
axios.post('./api/getDepartment.php').then(res => {
|
|
this.data.deparetment_options = res.data
|
|
}).catch(error => {
|
|
console.log(error.response.data)
|
|
})
|
|
}, getUser() {
|
|
axios.post('./api/getUser.php').then(res => {
|
|
this.data.user_options = res.data
|
|
}).catch(error => {
|
|
console.log(error.response.data)
|
|
})
|
|
}, changeDepartment() {
|
|
const form = new FormData();
|
|
form.append('department_id', this.data.department_id);
|
|
axios.post('./api/getUser.php', form).then(res => {
|
|
this.data.user_options = res.data
|
|
}).catch(error => {
|
|
console.log(error.response.data)
|
|
})
|
|
}, changeDetailsTable() {
|
|
const form = new FormData();
|
|
this.data.end_page = Math.ceil(this.data.all_count / this.data.per);
|
|
form.append('system_name', this.data.system_name);
|
|
form.append('department_id', this.data.department_id);
|
|
form.append('user_id', this.data.user_id);
|
|
form.append('now_page', this.data.now_page);
|
|
form.append('per', this.data.per);
|
|
form.append('search', this.data.search);
|
|
form.append('method', 'getSingDetails');
|
|
axios.post('./api/getSingedDetails.php', form).then(res => {
|
|
this.data.signDetails = res.data;
|
|
}).catch(error => {
|
|
console.log(error.response.data)
|
|
})
|
|
}, goEndPage() {
|
|
this.data.now_page = this.data.end_page
|
|
}, goFirstPage() {
|
|
this.data.now_page = 1
|
|
}, goLastPage() {
|
|
if (this.data.now_page > 1)
|
|
this.data.now_page--
|
|
}, goNextPage() {
|
|
this.data.now_page++
|
|
}, download() {
|
|
this.downloadLoading = true
|
|
const form = new FormData();
|
|
form.append('system_name', this.data.system_name);
|
|
form.append('department_id', this.data.department_id);
|
|
form.append('user_id', this.data.user_id);
|
|
form.append('search', this.data.search);
|
|
axios.post('./api/downloadExcel.php', form).then(res => {
|
|
var link = document.createElement('a');
|
|
link.setAttribute('href', window.location.origin + "/wms/excel/signed_overdue_date.xlsx");
|
|
link.setAttribute('download', '部門逾期待簽.xlsx');
|
|
link.style.display = 'none';
|
|
document.body.appendChild(link);
|
|
link.click();
|
|
document.body.removeChild(link);
|
|
this.downloadLoading = false
|
|
}).catch(error => {
|
|
console.log(error.response.data)
|
|
this.downloadLoading = false
|
|
})
|
|
}
|
|
}
|
|
}
|
|
|
|
|