代码更新
This commit is contained in:
parent
1a8296608e
commit
d5b76573e1
|
|
@ -24,8 +24,17 @@ const inventoryConfirmBack = (params) => {
|
|||
})
|
||||
}
|
||||
|
||||
const getInventoryRecord = (params) => {
|
||||
return request({
|
||||
url: '/record/getInventoryRecord',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
inventoryOut,
|
||||
getCurrentGoodsInventory,
|
||||
inventoryConfirmBack
|
||||
inventoryConfirmBack,
|
||||
getInventoryRecord
|
||||
}
|
||||
|
|
@ -1,50 +1,43 @@
|
|||
|
||||
<template>
|
||||
<div style="margin-bottom: 15px">
|
||||
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-row>
|
||||
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="零件号" />
|
||||
<el-input v-model="vehicleNoQuery" style="width: 256px; margin-right: 10px;" placeholder="箱号" />
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
<el-button type="success" @click="refresh()">刷新</el-button>
|
||||
</el-row>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="vehicleIdQuery" style="width: 158px; margin-right: 10px;" placeholder="箱号"
|
||||
:suffix-icon="Search" />
|
||||
<el-select-v2 v-if="queryType == 2" v-model="invResultQuery" style="width: 158px; margin-right: 10px;"
|
||||
placeholder="请选择盘点结果" :options="invResultOptions" @change="search()"></el-select-v2>
|
||||
<el-select-v2 v-model="queryType" style="width: 158px; margin-right: 10px;"
|
||||
placeholder="请选择查询类别" :options="queryTypeOptions" @change="search()"></el-select-v2>
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
<!-- <el-row>
|
||||
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
||||
</el-row> -->
|
||||
</div>
|
||||
<br />
|
||||
<el-table :data="tasks" stripe border v-loading="loading" style="width: 100%" max-height="684px"
|
||||
class="table-class" :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column prop="goodsId" label="零件号" fixed="left" min-width="120px" />
|
||||
<el-table-column prop="vehicleNo" label="箱号" fixed="left" min-width="120px" />
|
||||
<el-table-column prop="goodsName" label="零件名称" min-width="120px" />
|
||||
<el-table-column prop="taskType" label="任务类型" :formatter="taskTypeFormat" sortable min-width="120px" />
|
||||
<el-table-column prop="taskGroup" label="任务组" min-width="120px" />
|
||||
<el-table-column prop="origin" label="起点" min-width="120px" />
|
||||
<el-table-column prop="destination" label="终点" min-width="120px" />
|
||||
<el-table-column prop="pickStand" label="拣选站台" min-width="120px" />
|
||||
<el-table-column prop="weight" label="重量" min-width="120px" />
|
||||
<el-table-column prop="productionDate" label="生产日期" :formatter="dateFormat" min-width="120px" />
|
||||
<el-table-column prop="expirationDate" label="有效日期" :formatter="dateFormat" min-width="120px" />
|
||||
<el-table-column prop="operateNum" label="操作数量" min-width="120px" />
|
||||
<el-table-column prop="totalNum" label="库存数量" min-width="120px" />
|
||||
<el-table-column prop="taskPriority" label="任务优先级" sortable min-width="120px" />
|
||||
<el-table-column prop="kateTaskId" label="配件任务号" sortable min-width="140px" />
|
||||
<el-table-column prop="userName" label="操作人员姓名" min-width="120px" />
|
||||
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px" />
|
||||
<el-table-column prop="finishTime" label="任务完成时间" :formatter="timeFormat" min-width="120px" />
|
||||
<el-table-column prop="taskStatus" label="任务状态" fixed="right" :formatter="taskStatusFormat" min-width="120px" />
|
||||
<!-- <el-table-column fixed="right" label="操作" width="180px">
|
||||
<el-table :data="inventoryList" 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' }">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-popconfirm confirm-button-text="是" cancel-button-text="否" title="请确认是否取消任务?" :hide-after="10" @confirm="">
|
||||
<template #reference>
|
||||
<el-button plain type="warning">取消</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
<el-popconfirm confirm-button-text="是" cancel-button-text="否" title="请确认是否完成任务?" :hide-after="10" @confirm="">
|
||||
<template #reference>
|
||||
<el-button plain type="primary">完成</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
<el-radio :label="scope.row.inventoryId" v-model="inventoryId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table-column>
|
||||
<el-table-column prop="inventoryId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="goodsId" label="料号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="vehicleId" label="箱号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="stockNum" label="库存数量" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="realNum" label="确认数量" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="inventoryUser" label="盘点人员" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="inventoryStatus" label="盘点状态" :formatter="invStatusFormat"
|
||||
min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="inventoryDate" label="盘点日期" :formatter="dateFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="inventoryResult" label="盘点结果" fixed="right" :formatter="invResultFormat" min-width="120px" />
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
|
|
@ -56,81 +49,160 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getTaskRecords } from '@/api/record.js'
|
||||
import { dateFormatter, taskStatusFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import store from '@/store'
|
||||
import { getInventoryRecord } from '@/api/inventory.js'
|
||||
// import { downloadWorkSummaryExcel } from '@/api/excel.js'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'inventoryRecord',
|
||||
data() {
|
||||
return {
|
||||
pageInfo: {},
|
||||
tasks: [],
|
||||
inventoryList: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
goodsIdQuery: '',
|
||||
vehicleNoQuery: '',
|
||||
loading: true
|
||||
vehicleIdQuery: '',
|
||||
queryType: 1,
|
||||
invResultQuery: -99,
|
||||
loading: true,
|
||||
inventoryId: '',
|
||||
queryTypeOptions: [
|
||||
{
|
||||
value: 1,
|
||||
label: '盘点任务'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '盘点记录'
|
||||
}
|
||||
],
|
||||
invResultOptions: [
|
||||
{
|
||||
value: -99,
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: -1,
|
||||
label: '盘亏'
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
label: '正常'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '盘盈'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
queryType: this.queryType,
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
VehicleId: this.vehicleIdQuery.trim(),
|
||||
inventoryResult: this.invResultQuery == -99 ? null : this.invResultQuery,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getInventoryRecord(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.inventoryList = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询盘点信息错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
taskStatusFormat: (row, column, cellValue, index) => {
|
||||
return taskStatusFormatter(cellValue)
|
||||
},
|
||||
taskTypeFormat: (row, column, cellValue, index) => {
|
||||
invStatusFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 1: return '入库'
|
||||
case 2: return '出库'
|
||||
case 3: return '盘点'
|
||||
default: return '未知'
|
||||
case 0:
|
||||
return '未盘'
|
||||
case 1:
|
||||
return '已盘'
|
||||
default:
|
||||
return '未知'
|
||||
}
|
||||
},
|
||||
search() {
|
||||
this.loading = true
|
||||
this.pageInfo.pageNum = this.currentPage
|
||||
this.pageInfo.pageSize = this.pageSize
|
||||
const tableRequest = {
|
||||
page: this.pageInfo,
|
||||
param: {
|
||||
taskType: 3,
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
vehicleNo: this.vehicleNoQuery.trim(),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
invResultFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case -1:
|
||||
return '盘亏'
|
||||
case 0:
|
||||
return '正常'
|
||||
case 1:
|
||||
return '盘盈'
|
||||
default:
|
||||
return '未知'
|
||||
}
|
||||
getTaskRecords(tableRequest).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.tasks = tableResponse.rows
|
||||
this.total = tableResponse.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询盘点记录错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
reset() {
|
||||
this.goodsIdQuery = ''
|
||||
this.vehicleNoQuery = ''
|
||||
this.vehicleIdQuery = ''
|
||||
this.search()
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.workFlowId = row.workFlowId
|
||||
},
|
||||
exportExcel() {
|
||||
const request = {
|
||||
workStation: this.standIdQuery.trim(),
|
||||
workOrder: this.workOrderQuery.trim(),
|
||||
workCenter: this.workCenterQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery,
|
||||
workDate: timeFormatter(this.workDateQuery),
|
||||
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('导出失败')
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
@ -149,4 +221,35 @@ export default {
|
|||
.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;
|
||||
}
|
||||
|
||||
.title-area {
|
||||
display: flex;
|
||||
/* min-height: 10%; */
|
||||
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;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
<el-table-column prop="createTime" label="运行时长" :formatter="dueFormat" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="userName" label="操作人员姓名" min-width="120px" />
|
||||
<el-table-column prop="taskStatus" label="任务状态" fixed="right" :formatter="taskStatusFormat"
|
||||
min-width="120px" />
|
||||
min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column fixed="right" label="操作" width="120px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRowTask(scope.row)">编辑</el-button>
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
|||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'workFlow',
|
||||
name: 'workSummary',
|
||||
data() {
|
||||
return {
|
||||
workSummaryList: [],
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user