Compare commits

..

No commits in common. "c4a61f5b1ec0c0e6a8e19f053c3bf2cabf77360f" and "4452edc5178a6fe75ef4fed5a6b2281458a3f801" have entirely different histories.

3 changed files with 241 additions and 315 deletions

View File

@ -208,16 +208,6 @@ const downloadKateOrdersExcel = (data) => {
})
}
const downloadPickTaskRecordsExcel = (data) => {
return request({
url: '/excel/downloadPickTaskRecordsExcel',
method: 'post',
responseType: 'blob',
data: data,
timeout: 600000
})
}
export {
uploadExcelStock,
uploadExcelGoods,
@ -240,6 +230,5 @@ export {
uploadWorkFlow,
uploadExcelWorkDate,
downloadWorkFlowExcel,
downloadKateOrdersExcel,
downloadPickTaskRecordsExcel
downloadKateOrdersExcel
}

View File

@ -402,7 +402,7 @@ export default {
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //blobblobtypexls
let blob = res.data //blob
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //
let _fileName = "未做工单报表" + dateFormatter(this.planStartDateQuery) + ".xlsx"
let _fileName = "工单报表" + dateFormatter(new Date) + ".xlsx"
link.style.display = 'none'//
// URL

View File

@ -12,14 +12,6 @@
<el-button type="primary" @click="search()">搜索</el-button>
<el-button type="warning" @click="reset()">重置</el-button>
</el-row>
<el-row>
<el-date-picker v-model="dateQuery" type="date" placeholder="任务日期" :shortcuts="shortcuts"
style="width: 158px; margin-right: 10px;" clearable/>
<el-button style="background-color: #00CED1; color: #000; width: 120px"
@click="exportPickTaskRecords()">导出拣选任务记录
</el-button>
</el-row>
</div>
<br />
<el-table :data="pickTaskList" stripe border v-loading="loading" class="table-class" highlight-current-row
@ -99,12 +91,10 @@ import {errorBox} from '@/utils/myMessageBox.js'
import { ElMessage } from 'element-plus'
import { ref, reactive } from 'vue'
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
import {downloadPickTaskRecordsExcel} from "@/api/excel";
import { Search } from '@element-plus/icons-vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
</script>
<script>
export default {
name: 'pickTaskMonitor',
data() {
@ -116,7 +106,6 @@ export default {
vehicleIdQuery: '',
standQuery: '',
pickStatusQuery: -99,
dateQuery: null,
loading: true,
dialogVisible: false,
pickTaskId: '',
@ -164,20 +153,6 @@ export default {
label: '已到达'
}
],
shortcuts: [
{
text: '今天',
value: new Date(),
},
{
text: '昨天',
value: () => {
const date = new Date()
date.setTime(date.getTime() - 3600 * 1000 * 24)
return date
},
},
],
}
},
mounted() {
@ -266,44 +241,6 @@ export default {
getCurrentRow(row) {
this.pickTaskId = row.pickTaskId
},
//
exportPickTaskRecords() {
if (this.dateQuery == null) {
errorBox('请选择日期')
return
}
const request = {
vehicleId: this.vehicleIdQuery,
standId: this.standQuery,
workDate: dateFormatter(this.dateQuery),
userName: store.getters.getUserName
}
downloadPickTaskRecordsExcel(request).then(res => {
const link = document.createElement('a');//a
try {
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //blobblobtypexls
let blob = res.data //blob
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //
let _fileName = "拣选任务记录" + dateFormatter(this.dateQuery) + ".xlsx"
link.style.display = 'none'//
// URL
const url = window.URL || window.webkitURL || window.moxURL
link.href = url.createObjectURL(blob)
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
url.revokeObjectURL(link.href)//url
} catch (e) {
console.log(e)
errorBox('下载文件失败')
}
}).catch(err => {
console.log(err)
errorBox('导出失败')
})
},
},
}
</script>