2024-08-14 22:35:32 +08:00
|
|
|
|
<template>
|
2024-08-18 10:29:38 +08:00
|
|
|
|
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
2024-08-14 22:35:32 +08:00
|
|
|
|
<el-config-provider :locale="zhCn">
|
2024-08-18 10:29:38 +08:00
|
|
|
|
<div style="display: flex;justify-content: space-between;">
|
|
|
|
|
|
<el-row>
|
2025-09-06 12:54:31 +08:00
|
|
|
|
<el-input v-model="workOrderQuery" style="width: 158px; margin-right: 10px; height: 32px;" placeholder="工单号"
|
2024-08-18 10:29:38 +08:00
|
|
|
|
:suffix-icon="Search" />
|
2025-09-06 12:54:31 +08:00
|
|
|
|
<el-input v-model="workCenterQuery" style="width: 158px; margin-right: 10px; height: 32px;" placeholder="工位/小盒子"
|
2024-08-18 10:29:38 +08:00
|
|
|
|
:suffix-icon="Search" />
|
2025-09-06 12:54:31 +08:00
|
|
|
|
<el-input v-model="goodsIdQuery" type="textarea" :rows="1" style="width: 158px; margin-right: 10px; height: 32px;"
|
|
|
|
|
|
placeholder="请输入料号,多个料号请换行输入" class="goods-id-textarea" />
|
|
|
|
|
|
<el-input v-model="standIdQuery" style="width: 158px; margin-right: 10px; height: 32px;" placeholder="站台号"
|
2024-09-26 10:31:50 +08:00
|
|
|
|
:suffix-icon="Search" />
|
2025-03-11 15:20:20 +08:00
|
|
|
|
<el-date-picker v-model="workDateQuery" type="date" placeholder="工作起始日期" :shortcuts="shortcuts"
|
2024-10-05 16:42:35 +08:00
|
|
|
|
style="width: 158px; margin-right: 10px;" clearable />
|
2025-03-11 15:20:20 +08:00
|
|
|
|
<el-date-picker v-model="workEndDateQuery" type="date" placeholder="工作结束日期" :shortcuts="shortcuts"
|
|
|
|
|
|
style="width: 158px; margin-right: 10px;" clearable />
|
2024-09-26 10:31:50 +08:00
|
|
|
|
<el-select-v2 v-model="lackStatusQuery" style="width: 158px; margin-right: 10px;"
|
|
|
|
|
|
placeholder="请选择缺料状态" :options="lackStatusOptions" @change="search()"></el-select-v2>
|
2024-08-18 10:29:38 +08:00
|
|
|
|
<el-button type="primary" @click="search()">搜索</el-button>
|
|
|
|
|
|
<el-button type="warning" @click="reset()">重置</el-button>
|
|
|
|
|
|
</el-row>
|
2024-10-05 16:42:35 +08:00
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
|
|
|
|
|
</el-row>
|
2024-08-18 10:29:38 +08:00
|
|
|
|
</div>
|
2024-08-14 22:35:32 +08:00
|
|
|
|
<br />
|
2024-09-26 10:31:50 +08:00
|
|
|
|
<el-table :data="workSummaryList" stripe border v-loading="loading" class="table-class"
|
|
|
|
|
|
highlight-current-row max-height="650px" @row-click="getCurrentRow"
|
|
|
|
|
|
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
|
2024-08-14 22:35:32 +08:00
|
|
|
|
<el-table-column width="65px" fixed="left">
|
|
|
|
|
|
<template v-slot="scope">
|
2024-09-26 10:31:50 +08:00
|
|
|
|
<el-radio :label="scope.row.workFlowId" v-model="workFlowId"> </el-radio>
|
2024-08-14 22:35:32 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
2024-09-26 10:31:50 +08:00
|
|
|
|
<el-table-column prop="workFlowId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
|
|
|
|
|
<el-table-column prop="workStation" label="站台号" min-width="120px" show-overflow-tooltip />
|
|
|
|
|
|
<el-table-column prop="workOrder" label="工单号" min-width="120px" show-overflow-tooltip />
|
|
|
|
|
|
<el-table-column prop="workCenter" label="工位/小盒子" show-overflow-tooltip min-width="120px" />
|
|
|
|
|
|
<el-table-column prop="goodsId" label="料号" min-width="120px" show-overflow-tooltip />
|
|
|
|
|
|
<el-table-column prop="needNum" label="需求数量" min-width="120px" />
|
|
|
|
|
|
<el-table-column prop="pickedNum" label="已拣数量" min-width="120px" />
|
|
|
|
|
|
<el-table-column prop="lackNum" label="缺件数量" min-width="120px" />
|
|
|
|
|
|
<el-table-column prop="eLocationId" label="拣货位置" min-width="120px" />
|
|
|
|
|
|
<el-table-column prop="lackStatus" label="缺料状态" fixed="right" :formatter="lackStatusFormat"
|
2024-09-10 17:03:11 +08:00
|
|
|
|
min-width="120px" />
|
2024-09-26 10:31:50 +08:00
|
|
|
|
<el-table-column prop="workStatus" label="工作状态" :formatter="workStatusFormat" min-width="120px" />
|
|
|
|
|
|
<el-table-column prop="workDate" label="工作日期" :formatter="dateFormat" min-width="120px"
|
|
|
|
|
|
show-overflow-tooltip />
|
|
|
|
|
|
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px"
|
|
|
|
|
|
show-overflow-tooltip />
|
|
|
|
|
|
<el-table-column prop="opUser" label="操作用户" min-width="120px" />
|
2024-08-14 22:35:32 +08:00
|
|
|
|
</el-table>
|
|
|
|
|
|
<br />
|
|
|
|
|
|
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
|
|
|
|
|
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
|
|
|
|
|
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
|
|
|
|
|
@current-change="search" />
|
|
|
|
|
|
</el-config-provider>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2024-08-18 10:29:38 +08:00
|
|
|
|
import store from '@/store'
|
2024-09-26 10:31:50 +08:00
|
|
|
|
import { getWorkSummary } from '@/api/kateWork.js'
|
2024-10-05 16:42:35 +08:00
|
|
|
|
import { downloadWorkSummaryExcel } from '@/api/excel.js'
|
2024-09-20 18:35:31 +08:00
|
|
|
|
import { errorBox } from '@/utils/myMessageBox.js'
|
2024-08-18 10:29:38 +08:00
|
|
|
|
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
|
|
|
|
|
import { Search } from '@element-plus/icons-vue'
|
2024-09-10 17:03:11 +08:00
|
|
|
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
2024-08-14 22:35:32 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
export default {
|
2025-01-22 14:57:16 +08:00
|
|
|
|
name: 'workSummary',
|
2024-08-14 22:35:32 +08:00
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2024-09-26 10:31:50 +08:00
|
|
|
|
workSummaryList: [],
|
2024-08-14 22:35:32 +08:00
|
|
|
|
currentPage: 1,
|
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
|
total: 0,
|
2024-09-26 10:31:50 +08:00
|
|
|
|
workOrderQuery: '',
|
|
|
|
|
|
workCenterQuery: '',
|
|
|
|
|
|
goodsIdQuery: '',
|
|
|
|
|
|
standIdQuery: '',
|
|
|
|
|
|
workDateQuery: null,
|
2025-03-11 15:20:20 +08:00
|
|
|
|
workEndDateQuery: null,
|
2024-09-26 10:31:50 +08:00
|
|
|
|
shortcuts: [
|
|
|
|
|
|
{
|
|
|
|
|
|
text: '今天',
|
|
|
|
|
|
value: new Date(),
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
text: '昨天',
|
|
|
|
|
|
value: () => {
|
|
|
|
|
|
const date = new Date()
|
|
|
|
|
|
date.setTime(date.getTime() - 3600 * 1000 * 24)
|
|
|
|
|
|
return date
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
lackStatusQuery: -99,
|
2024-08-14 22:35:32 +08:00
|
|
|
|
loading: true,
|
2024-09-26 10:31:50 +08:00
|
|
|
|
workFlowId: '',
|
|
|
|
|
|
lackStatusOptions: [
|
2024-09-10 17:03:11 +08:00
|
|
|
|
{
|
2024-09-26 10:31:50 +08:00
|
|
|
|
value: -99,
|
|
|
|
|
|
label: '全部'
|
2024-09-10 17:03:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
value: 0,
|
2024-09-26 10:31:50 +08:00
|
|
|
|
label: '不缺'
|
2024-09-10 17:03:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
value: 1,
|
2024-09-26 10:31:50 +08:00
|
|
|
|
label: '缺料'
|
2024-09-10 17:03:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
],
|
2024-08-14 22:35:32 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
mounted() {
|
|
|
|
|
|
this.search()
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
search() {
|
|
|
|
|
|
this.loading = true
|
2024-08-18 10:29:38 +08:00
|
|
|
|
const request = {
|
2024-08-14 22:35:32 +08:00
|
|
|
|
pageNo: this.currentPage,
|
|
|
|
|
|
pageSize: this.pageSize,
|
2024-09-26 10:31:50 +08:00
|
|
|
|
workStation: this.standIdQuery.trim(),
|
|
|
|
|
|
workOrder: this.workOrderQuery.trim(),
|
|
|
|
|
|
workCenter: this.workCenterQuery.trim(),
|
2025-09-06 12:54:31 +08:00
|
|
|
|
goodsId: this.goodsIdQuery.trim().split('\n').filter(id => id.trim() !== '').join(','),
|
2024-09-26 10:31:50 +08:00
|
|
|
|
lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery,
|
|
|
|
|
|
workDate: timeFormatter(this.workDateQuery),
|
2025-03-11 15:20:20 +08:00
|
|
|
|
workEndDate: timeFormatter(this.workEndDateQuery),
|
2024-08-14 22:35:32 +08:00
|
|
|
|
userName: store.getters.getUserName
|
|
|
|
|
|
}
|
2024-09-26 10:31:50 +08:00
|
|
|
|
getWorkSummary(request).then(res => {
|
2024-08-14 22:35:32 +08:00
|
|
|
|
const tableResponse = res.data
|
|
|
|
|
|
if (tableResponse.code == 0) {
|
2024-09-26 10:31:50 +08:00
|
|
|
|
this.workSummaryList = tableResponse.returnData.lists
|
2024-08-14 22:35:32 +08:00
|
|
|
|
this.total = tableResponse.returnData.total
|
|
|
|
|
|
} else {
|
2024-09-26 10:31:50 +08:00
|
|
|
|
errorBox(tableResponse.message)
|
2024-08-14 22:35:32 +08:00
|
|
|
|
}
|
|
|
|
|
|
}).catch(err => {
|
2024-09-26 10:31:50 +08:00
|
|
|
|
console.log(err)
|
|
|
|
|
|
errorBox('查询工作总结错误')
|
2024-08-14 22:35:32 +08:00
|
|
|
|
})
|
|
|
|
|
|
this.loading = false
|
|
|
|
|
|
},
|
2024-08-18 10:29:38 +08:00
|
|
|
|
dateFormat: (row, column, cellValue, index) => {
|
|
|
|
|
|
return dateFormatter(cellValue)
|
2024-08-14 22:35:32 +08:00
|
|
|
|
},
|
|
|
|
|
|
timeFormat: (row, column, cellValue, index) => {
|
|
|
|
|
|
return timeFormatter(cellValue)
|
|
|
|
|
|
},
|
2024-09-26 10:31:50 +08:00
|
|
|
|
lackStatusFormat: (row, column, cellValue, index) => {
|
|
|
|
|
|
switch (cellValue) {
|
|
|
|
|
|
case 0:
|
|
|
|
|
|
return '不缺'
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
return '缺料'
|
|
|
|
|
|
default:
|
|
|
|
|
|
return '未知'
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
workStatusFormat: (row, column, cellValue, index) => {
|
2024-09-10 17:03:11 +08:00
|
|
|
|
switch (cellValue) {
|
|
|
|
|
|
case 0:
|
2024-09-26 10:31:50 +08:00
|
|
|
|
return '未开始'
|
2024-09-10 17:03:11 +08:00
|
|
|
|
case 1:
|
2024-09-26 10:31:50 +08:00
|
|
|
|
return '正在做'
|
2024-09-10 17:03:11 +08:00
|
|
|
|
case 2:
|
2024-09-26 10:31:50 +08:00
|
|
|
|
return '已完成'
|
2024-09-10 17:03:11 +08:00
|
|
|
|
default:
|
|
|
|
|
|
return '未知'
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2024-08-14 22:35:32 +08:00
|
|
|
|
reset() {
|
2024-09-26 10:31:50 +08:00
|
|
|
|
this.standIdQuery = ''
|
|
|
|
|
|
this.workOrderQuery = ''
|
|
|
|
|
|
this.workCenterQuery = ''
|
|
|
|
|
|
this.goodsIdQuery = ''
|
|
|
|
|
|
this.workDateQuery = null
|
2024-08-14 22:35:32 +08:00
|
|
|
|
this.search()
|
|
|
|
|
|
},
|
|
|
|
|
|
getCurrentRow(row) {
|
2024-09-26 10:31:50 +08:00
|
|
|
|
this.workFlowId = row.workFlowId
|
2024-08-14 22:35:32 +08:00
|
|
|
|
},
|
2024-10-05 16:42:35 +08:00
|
|
|
|
exportExcel() {
|
|
|
|
|
|
const request = {
|
|
|
|
|
|
workStation: this.standIdQuery.trim(),
|
|
|
|
|
|
workOrder: this.workOrderQuery.trim(),
|
|
|
|
|
|
workCenter: this.workCenterQuery.trim(),
|
2025-09-06 12:54:31 +08:00
|
|
|
|
goodsId: this.goodsIdQuery.trim().split('\n').filter(id => id.trim() !== '').join(','),
|
2024-10-05 16:42:35 +08:00
|
|
|
|
lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery,
|
|
|
|
|
|
workDate: timeFormatter(this.workDateQuery),
|
2025-09-06 12:54:31 +08:00
|
|
|
|
workEndDate: timeFormatter(this.workEndDateQuery),
|
2024-10-05 16:42:35 +08:00
|
|
|
|
userName: store.getters.getUserName
|
|
|
|
|
|
}
|
|
|
|
|
|
downloadWorkSummaryExcel(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(new Date) + ".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('导出失败')
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2024-08-18 10:29:38 +08:00
|
|
|
|
},
|
2024-08-14 22:35:32 +08:00
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
.el-pagination {
|
|
|
|
|
|
padding-left: 5px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.el-row .el-button {
|
|
|
|
|
|
width: 72px;
|
|
|
|
|
|
margin-left: 0px;
|
|
|
|
|
|
margin-right: 5px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.table-class {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.el-row .el-form-item {
|
|
|
|
|
|
width: 10% inherit;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.el-row .el-form-item .el-select-v2 {
|
|
|
|
|
|
width: 100% !important;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.el-row .el-form-item .el-input-number {
|
|
|
|
|
|
width: 100% !important;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.el-row .el-form-item .el-button {
|
|
|
|
|
|
margin: auto;
|
|
|
|
|
|
}
|
2024-08-18 10:29:38 +08:00
|
|
|
|
|
|
|
|
|
|
.title-area {
|
|
|
|
|
|
display: flex;
|
2024-09-02 13:46:13 +08:00
|
|
|
|
/* min-height: 10%; */
|
2024-08-18 10:29:38 +08:00
|
|
|
|
max-height: max-content;
|
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
|
min-width: inherit;
|
|
|
|
|
|
border: solid 1px;
|
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
|
box-shadow: 0px 15px 10px -15px #000;
|
|
|
|
|
|
overflow: auto;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
padding: 10px;
|
|
|
|
|
|
}
|
2025-09-06 12:54:31 +08:00
|
|
|
|
|
|
|
|
|
|
/* 专门为料号文本域添加样式 */
|
|
|
|
|
|
.goods-id-container {
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
vertical-align: top;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.goods-id-textarea {
|
|
|
|
|
|
vertical-align: top;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.goods-id-textarea :deep(.el-textarea__inner) {
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
line-height: 1.2;
|
|
|
|
|
|
padding: 5px;
|
|
|
|
|
|
height: 32px !important;
|
|
|
|
|
|
min-height: 32px !important;
|
|
|
|
|
|
resize: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* 确保其他输入框保持一致的高度 */
|
|
|
|
|
|
.el-input {
|
|
|
|
|
|
height: 32px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.el-input :deep(.el-input__wrapper) {
|
|
|
|
|
|
height: 32px;
|
|
|
|
|
|
line-height: 32px;
|
|
|
|
|
|
}
|
2024-08-14 22:35:32 +08:00
|
|
|
|
</style>
|