Compare commits
No commits in common. "c4a61f5b1ec0c0e6a8e19f053c3bf2cabf77360f" and "4452edc5178a6fe75ef4fed5a6b2281458a3f801" have entirely different histories.
c4a61f5b1e
...
4452edc517
|
|
@ -208,16 +208,6 @@ const downloadKateOrdersExcel = (data) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const downloadPickTaskRecordsExcel = (data) => {
|
|
||||||
return request({
|
|
||||||
url: '/excel/downloadPickTaskRecordsExcel',
|
|
||||||
method: 'post',
|
|
||||||
responseType: 'blob',
|
|
||||||
data: data,
|
|
||||||
timeout: 600000
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
uploadExcelStock,
|
uploadExcelStock,
|
||||||
uploadExcelGoods,
|
uploadExcelGoods,
|
||||||
|
|
@ -240,6 +230,5 @@ export {
|
||||||
uploadWorkFlow,
|
uploadWorkFlow,
|
||||||
uploadExcelWorkDate,
|
uploadExcelWorkDate,
|
||||||
downloadWorkFlowExcel,
|
downloadWorkFlowExcel,
|
||||||
downloadKateOrdersExcel,
|
downloadKateOrdersExcel
|
||||||
downloadPickTaskRecordsExcel
|
|
||||||
}
|
}
|
||||||
|
|
@ -402,7 +402,7 @@ export default {
|
||||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
// 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'//隐藏
|
link.style.display = 'none'//隐藏
|
||||||
|
|
||||||
// 兼容不同浏览器的URL对象
|
// 兼容不同浏览器的URL对象
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,6 @@
|
||||||
<el-button type="primary" @click="search()">搜索</el-button>
|
<el-button type="primary" @click="search()">搜索</el-button>
|
||||||
<el-button type="warning" @click="reset()">重置</el-button>
|
<el-button type="warning" @click="reset()">重置</el-button>
|
||||||
</el-row>
|
</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>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<el-table :data="pickTaskList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
<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 { ElMessage } from 'element-plus'
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||||
import {downloadPickTaskRecordsExcel} from "@/api/excel";
|
|
||||||
import { Search } from '@element-plus/icons-vue'
|
import { Search } from '@element-plus/icons-vue'
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'pickTaskMonitor',
|
name: 'pickTaskMonitor',
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -116,7 +106,6 @@ export default {
|
||||||
vehicleIdQuery: '',
|
vehicleIdQuery: '',
|
||||||
standQuery: '',
|
standQuery: '',
|
||||||
pickStatusQuery: -99,
|
pickStatusQuery: -99,
|
||||||
dateQuery: null,
|
|
||||||
loading: true,
|
loading: true,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
pickTaskId: '',
|
pickTaskId: '',
|
||||||
|
|
@ -164,20 +153,6 @@ export default {
|
||||||
label: '已到达'
|
label: '已到达'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
shortcuts: [
|
|
||||||
{
|
|
||||||
text: '今天',
|
|
||||||
value: new Date(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '昨天',
|
|
||||||
value: () => {
|
|
||||||
const date = new Date()
|
|
||||||
date.setTime(date.getTime() - 3600 * 1000 * 24)
|
|
||||||
return date
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
@ -266,44 +241,6 @@ export default {
|
||||||
getCurrentRow(row) {
|
getCurrentRow(row) {
|
||||||
this.pickTaskId = row.pickTaskId
|
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'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
|
||||||
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>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user