代码更新:

1. 增加非计划领料的防呆
2. 增加入库界面不合并功能
3. 增加日期筛选功能
This commit is contained in:
梁州 2024-11-19 16:51:10 +08:00
parent 11f5414a14
commit 399192c527
7 changed files with 220 additions and 74 deletions

View File

@ -201,6 +201,7 @@ import { errorBox, successBox } from '@/utils/myMessageBox.js'
import { getStockNumByGoodsId } from '@/api/stock'
import { reactive, ref } from 'vue'
import { ElMessage } from 'element-plus'
import loading from '@/utils/loading.js'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
</script>
@ -299,6 +300,7 @@ export default {
},
//
createTask() {
loading.open('处理中,请稍等...')
if (this.standId == '' || this.workFormEntity.goodsId == '') {
errorBox('站台号和料号不可缺少')
return
@ -314,6 +316,7 @@ export default {
userName: store.getters.getUserName
}
clcNoPlan(requestParams).then(res => {
loading.close()
const response = res.data
if (response.code == 0) {
successBox(response.message)
@ -322,6 +325,7 @@ export default {
errorBox(response.message)
}
}).catch(err => {
loading.close()
console.log(err)
errorBox('请求时发生异常。')
})

View File

@ -49,9 +49,8 @@
</div>
<div style="display: flex; margin-top: 20px;">
<div class="display-form-div-left">
<el-input v-model="workFormEntity.goodsNum"
controls-position="right" ref="goodsNum" clearable
v-on:keyup.enter="addTempTask()" />
<el-input v-model="workFormEntity.goodsNum" controls-position="right"
ref="goodsNum" clearable v-on:keyup.enter="addTempTask()" />
</div>
<div class="display-form-div-right">
<span class="display-form-text-right">PC</span>
@ -193,17 +192,22 @@ export default {
type: 'warning',
}
).then(() => {
const sameIndex = this.tempTasks.findIndex(task => task.goodsId == this.workFormEntity.goodsId)
if (sameIndex != -1) {//
var sameGoods = this.tempTasks[sameIndex]
sameGoods.goodsNum = sameGoods.goodsNum + this.workFormEntity.goodsNum
} else {
// const sameIndex = this.tempTasks.findIndex(task => task.goodsId == this.workFormEntity.goodsId)
// if (sameIndex != -1) {//
// var sameGoods = this.tempTasks[sameIndex]
// sameGoods.goodsNum = sameGoods.goodsNum + this.workFormEntity.goodsNum
// } else {
// this.tempTasks.push({
// vehicleId: this.workFormEntity.vehicleId,
// goodsId: this.workFormEntity.goodsId,
// goodsNum: this.workFormEntity.goodsNum
// })
// }
this.tempTasks.push({
vehicleId: this.workFormEntity.vehicleId,
goodsId: this.workFormEntity.goodsId,
goodsNum: this.workFormEntity.goodsNum
})
}
this.currentVehicleId = this.workFormEntity.vehicleId
this.workFormEntity.goodsId = ''
this.workFormEntity.goodsNum = ''
@ -216,17 +220,22 @@ export default {
return
})
} else {
const sameIndex = this.tempTasks.findIndex(task => task.goodsId == this.workFormEntity.goodsId)
if (sameIndex != -1) {//
var sameGoods = this.tempTasks[sameIndex]
sameGoods.goodsNum = sameGoods.goodsNum + this.workFormEntity.goodsNum
} else {
// const sameIndex = this.tempTasks.findIndex(task => task.goodsId == this.workFormEntity.goodsId)
// if (sameIndex != -1) {//
// var sameGoods = this.tempTasks[sameIndex]
// sameGoods.goodsNum = sameGoods.goodsNum + this.workFormEntity.goodsNum
// } else {
// this.tempTasks.push({
// vehicleId: this.workFormEntity.vehicleId,
// goodsId: this.workFormEntity.goodsId,
// goodsNum: this.workFormEntity.goodsNum
// })
// }
this.tempTasks.push({
vehicleId: this.workFormEntity.vehicleId,
goodsId: this.workFormEntity.goodsId,
goodsNum: this.workFormEntity.goodsNum
})
}
this.currentVehicleId = this.workFormEntity.vehicleId
this.workFormEntity.goodsId = ''
this.workFormEntity.goodsNum = ''
@ -251,7 +260,7 @@ export default {
deleteRowTask(row) {//
this.tempTasks.splice(this.tempTasks.indexOf(row), 1)
if (this.tempTasks.length == 0) {
this.tempVehicleNo = ''
this.currentVehicleId = ''
}
},
confirmTask() {
@ -261,10 +270,25 @@ export default {
errorBox('必须输入料箱号')
return
}
//
var taskList = []
for (var i = 0; i < this.tempTasks.length; i++) {
var sameIndex = taskList.findIndex(task => task.goodsId == this.tempTasks[i].goodsId)
if (sameIndex != -1) {//
var sameGoods = taskList[sameIndex]
sameGoods.goodsNum = sameGoods.goodsNum + this.tempTasks[i].goodsNum
} else {
taskList.push({
vehicleId: this.tempTasks[i].vehicleId,
goodsId: this.tempTasks[i].goodsId,
goodsNum: this.tempTasks[i].goodsNum
})
}
}
const request = {
vehicleId: this.currentVehicleId,
userName: store.getters.getUserName,
goodsList: this.tempTasks.length > 0 ? this.tempTasks : [],
goodsList: taskList.length > 0 ? taskList : [],
}
sendGoodsInTask(request).then(res => {
loading.close()

View File

@ -216,17 +216,22 @@ export default {
type: 'warning',
}
).then(() => {
const sameIndex = this.tempTasks.findIndex(task => task.goodsId == this.workFormEntity.goodsId)
if (sameIndex != -1) {//
var sameGoods = this.tempTasks[sameIndex]
sameGoods.goodsNum = sameGoods.goodsNum + this.workFormEntity.goodsNum
} else {
// const sameIndex = this.tempTasks.findIndex(task => task.goodsId == this.workFormEntity.goodsId)
// if (sameIndex != -1) {//
// var sameGoods = this.tempTasks[sameIndex]
// sameGoods.goodsNum = sameGoods.goodsNum + this.workFormEntity.goodsNum
// } else {
// this.tempTasks.push({
// vehicleId: this.workFormEntity.vehicleId,
// goodsId: this.workFormEntity.goodsId,
// goodsNum: this.workFormEntity.goodsNum
// })
// }
this.tempTasks.push({
vehicleId: this.workFormEntity.vehicleId,
goodsId: this.workFormEntity.goodsId,
goodsNum: this.workFormEntity.goodsNum
})
}
this.currentVehicleId = this.workFormEntity.vehicleId
this.workFormEntity.goodsId = ''
this.workFormEntity.goodsNum = null
@ -240,17 +245,22 @@ export default {
return
})
} else {
const sameIndex = this.tempTasks.findIndex(task => task.goodsId == this.workFormEntity.goodsId)
if (sameIndex != -1) {//
var sameGoods = this.tempTasks[sameIndex]
sameGoods.goodsNum = sameGoods.goodsNum + this.workFormEntity.goodsNum
} else {
// const sameIndex = this.tempTasks.findIndex(task => task.goodsId == this.workFormEntity.goodsId)
// if (sameIndex != -1) {//
// var sameGoods = this.tempTasks[sameIndex]
// sameGoods.goodsNum = sameGoods.goodsNum + this.workFormEntity.goodsNum
// } else {
// this.tempTasks.push({
// vehicleId: this.workFormEntity.vehicleId,
// goodsId: this.workFormEntity.goodsId,
// goodsNum: this.workFormEntity.goodsNum
// })
// }
this.tempTasks.push({
vehicleId: this.workFormEntity.vehicleId,
goodsId: this.workFormEntity.goodsId,
goodsNum: this.workFormEntity.goodsNum
})
}
this.currentVehicleId = this.workFormEntity.vehicleId
this.workFormEntity.goodsId = ''
this.workFormEntity.goodsNum = null
@ -272,7 +282,7 @@ export default {
deleteRowTask(row) {//
this.tempTasks.splice(this.tempTasks.indexOf(row), 1)
if (this.tempTasks.length == 0) {
this.tempVehicleNo = ''
this.currentVehicleId = ''
}
},
confirmTask() {
@ -282,10 +292,25 @@ export default {
errorBox('必须输入料箱号')
return
}
//
var taskList = []
for (var i = 0; i < this.tempTasks.length; i++) {
var sameIndex = taskList.findIndex(task => task.goodsId == this.tempTasks[i].goodsId)
if (sameIndex != -1) {//
var sameGoods = taskList[sameIndex]
sameGoods.goodsNum = sameGoods.goodsNum + this.tempTasks[i].goodsNum
} else {
taskList.push({
vehicleId: this.tempTasks[i].vehicleId,
goodsId: this.tempTasks[i].goodsId,
goodsNum: this.tempTasks[i].goodsNum
})
}
}
const request = {
vehicleId: this.currentVehicleId,
userName: store.getters.getUserName,
goodsList: this.tempTasks.length > 0 ? this.tempTasks : [],
goodsList: taskList.length > 0 ? taskList : [],
}
sendGoodsInTask(request).then(res => {
loading.close()

View File

@ -2,8 +2,12 @@
<div style="margin-bottom: 15px">
<el-config-provider :locale="zhCn">
<el-row>
<el-input v-model="vehicleIdQuery" style="width: 256px; margin-right: 10px;" placeholder="箱号" />
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="料号" />
<el-input v-model="vehicleIdQuery" style="width: 158px; margin-right: 10px;" placeholder="箱号" />
<el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号" />
<el-date-picker v-model="createTimeQuery" type="date" placeholder="选择创建日期" :shortcuts="shortcuts"
style="width: 158px; margin-right: 10px;" clearable />
<el-date-picker v-model="finishTimeQuery" type="date" placeholder="选择完成日期" :shortcuts="shortcuts"
style="width: 158px; margin-right: 10px;" clearable />
<el-button type="primary" @click="search()">搜索</el-button>
<el-button type="warning" @click="reset()">重置</el-button>
<el-button type="success" @click="exportExcel()">导出记录</el-button>
@ -13,7 +17,8 @@
class="table-class" :header-cell-style="{ 'text-align': 'center' }"
:cell-style="{ 'text-align': 'center' }">
<el-table-column prop="taskId" label="任务号" fixed="left" show-overflow-tooltip min-width="120px" />
<el-table-column prop="taskType" label="任务类型" fixed="left" :formatter="taskTypeFormat" min-width="120px" />
<el-table-column prop="taskType" label="任务类型" fixed="left" :formatter="taskTypeFormat"
min-width="120px" />
<el-table-column prop="vehicleId" label="箱号" min-width="120px" show-overflow-tooltip />
<el-table-column prop="goodsRelated.goodsId" label="料号" min-width="120px" show-overflow-tooltip />
<el-table-column prop="goodsRelated.goodsName" label="料名" min-width="120px" show-overflow-tooltip />
@ -24,7 +29,10 @@
<el-table-column prop="goodsRelated.originNum" label="库存数量" min-width="120px" />
<el-table-column prop="taskPriority" label="任务优先级" min-width="120px" />
<el-table-column prop="preTask" label="前置任务" min-width="120px" show-overflow-tooltip />
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px" show-overflow-tooltip />
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px"
show-overflow-tooltip />
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" 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" />
@ -58,6 +66,22 @@ export default {
goodsIdQuery: '',
vehicleIdQuery: '',
loading: true,
createTimeQuery: null,
finishTimeQuery: null,
shortcuts: [
{
text: '今天',
value: new Date(),
},
{
text: '昨天',
value: () => {
const date = new Date()
date.setTime(date.getTime() - 3600 * 1000 * 24)
return date
},
},
],
}
},
mounted() {
@ -89,7 +113,9 @@ export default {
pageSize: this.pageSize,
taskType: 1,
goodsId: this.goodsIdQuery.trim(),
vehicleId: this.vehicleIdQuery.trim()
vehicleId: this.vehicleIdQuery.trim(),
createTime: timeFormatter(this.createTimeQuery),
finishTime: timeFormatter(this.finishTimeQuery),
}
getTaskRecords(tableRequest).then(res => {
const tableResponse = res.data
@ -108,12 +134,16 @@ export default {
reset() {
this.goodsIdQuery = ''
this.vehicleIdQuery = ''
this.createTimeQuery = null
this.finishTimeQuery = null
this.search()
},
exportExcel() {
const params = {
vehicleId: this.vehicleIdQuery.trim(),
goodsId: this.goodsIdQuery.trim(),
createTime: timeFormatter(this.createTimeQuery),
finishTime: timeFormatter(this.finishTimeQuery),
userName: store.getters.getUserName
}
downloadInRecordExcel(params).then(res => {

View File

@ -3,8 +3,12 @@
<div style="margin-bottom: 15px">
<el-config-provider :locale="zhCn">
<el-row>
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="料号" />
<el-input v-model="vehicleIdQuery" style="width: 256px; margin-right: 10px;" placeholder="箱号" />
<el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号" />
<el-input v-model="vehicleIdQuery" style="width: 158px; margin-right: 10px;" placeholder="箱号" />
<el-date-picker v-model="createTimeQuery" type="date" placeholder="选择创建日期" :shortcuts="shortcuts"
style="width: 158px; margin-right: 10px;" clearable />
<el-date-picker v-model="finishTimeQuery" type="date" placeholder="选择完成日期" :shortcuts="shortcuts"
style="width: 158px; margin-right: 10px;" clearable />
<el-button type="primary" @click="search()">搜索</el-button>
<el-button type="warning" @click="reset()">重置</el-button>
<el-button type="success" @click="exportExcel()">导出记录</el-button>
@ -25,6 +29,8 @@
<el-table-column prop="taskPriority" label="任务优先级" min-width="120px" />
<el-table-column prop="preTask" label="前置任务" min-width="120px" show-overflow-tooltip />
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px" show-overflow-tooltip />
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" 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" />
@ -58,7 +64,23 @@ export default {
total: 0,
goodsIdQuery: '',
vehicleIdQuery: '',
loading: true
loading: true,
createTimeQuery: null,
finishTimeQuery: null,
shortcuts: [
{
text: '今天',
value: new Date(),
},
{
text: '昨天',
value: () => {
const date = new Date()
date.setTime(date.getTime() - 3600 * 1000 * 24)
return date
},
},
],
}
},
mounted() {
@ -90,7 +112,9 @@ export default {
pageSize: this.pageSize,
taskType: 2,
goodsId: this.goodsIdQuery.trim(),
vehicleId: this.vehicleIdQuery.trim()
vehicleId: this.vehicleIdQuery.trim(),
createTime: timeFormatter(this.createTimeQuery),
finishTime: timeFormatter(this.finishTimeQuery),
}
getTaskRecords(tableRequest).then(res => {
const tableResponse = res.data
@ -102,19 +126,23 @@ export default {
}
}).catch(err => {
console.log(err)
ElMessage.error('查询任务记录错误')
errorBox('查询任务记录错误')
})
this.loading = false
},
reset() {
this.goodsTypeQuery = ''
this.specificationQuery = ''
this.goodsIdQuery = ''
this.vehicleIdQuery = ''
this.createTimeQuery = null
this.finishTimeQuery = null
this.search()
},
exportExcel() {
const params = {
vehicleId: this.vehicleIdQuery.trim(),
goodsId: this.goodsIdQuery.trim(),
createTime: timeFormatter(this.createTimeQuery),
finishTime: timeFormatter(this.finishTimeQuery),
userName: store.getters.userName
}
downloadOutRecordExcel(params).then(res => {
@ -135,18 +163,12 @@ export default {
document.body.removeChild(link)
url.revokeObjectURL(link.href)//url
} catch (e) {
ElMessage({
message: '下载文件失败:: ' + e,
type: 'error',
showClose: true
})
console.log(e)
errorBox('下载文件失败')
}
}).catch(err => {
ElMessage({
message: '导出失败:: ' + err,
type: 'error',
showClose: true
})
console.log(err)
errorBox('导出失败')
})
},
},

View File

@ -18,6 +18,8 @@
:suffix-icon="Search" />
<el-input v-model="locationIdQuery" style="width: 196px; margin-right: 10px;" placeholder="库位"
:suffix-icon="Search" />
<el-date-picker v-model="createTimeQuery" type="date" placeholder="选择上架日期" :shortcuts="shortcuts"
style="width: 158px; margin-right: 10px;" clearable />
<el-button type="primary" @click="search()">搜索</el-button>
<el-button type="warning" @click="reset()">重置</el-button>
</el-row>
@ -28,14 +30,16 @@
<br />
<el-table id="stock-table" :data="displayStocks" stripe border v-loading="loading" class="table-class"
max-height="650px" highlight-current-row @row-click="getCurrentRow" :row-style="rowStyle"
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }" @sort-change="handleSortChange">
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
@sort-change="handleSortChange">
<el-table-column width="65px" fixed="left">
<template v-slot="scope">
<el-radio :label="scope.row.stockId" v-model="stockId">&nbsp;</el-radio>
</template>
</el-table-column>
<el-table-column prop="stockId" label="库存编号" fixed="left" min-width="120px" show-overflow-tooltip />
<el-table-column prop="vehicleId" label="箱号" fixed="left" min-width="120px" sortable="custom" show-overflow-tooltip />
<el-table-column prop="vehicleId" label="箱号" fixed="left" min-width="120px" sortable="custom"
show-overflow-tooltip />
<el-table-column prop="goodsId" label="物料号" fixed="left" min-width="120px" show-overflow-tooltip />
<el-table-column prop="goodsName" label="物料名称" min-width="120px" show-overflow-tooltip />
<el-table-column prop="locationId" label="库位" :formatter="locationFormat" min-width="120px"
@ -48,10 +52,10 @@
<el-table-column prop="isInventory" label="是否盘点" :formatter="yesOrNoFormat" min-width="120px" />
<el-table-column prop="inventoryTaskId" label="盘点任务号" min-width="120px" />
<el-table-column prop="noUseDays" label="未使用天数" min-width="120px" />
<el-table-column prop="createTime" label="上架时间" sortable="custom" :formatter="timeFormat" min-width="120px"
show-overflow-tooltip />
<el-table-column prop="lastUpdateTime" label="最近更新时间" sortable="custom" :formatter="timeFormat" min-width="140px"
show-overflow-tooltip />
<el-table-column prop="createTime" label="上架时间" sortable="custom" :formatter="timeFormat"
min-width="120px" show-overflow-tooltip />
<el-table-column prop="lastUpdateTime" label="最近更新时间" sortable="custom" :formatter="timeFormat"
min-width="140px" show-overflow-tooltip />
<el-table-column prop="lastUpdateUser" label="最近更新用户" min-width="120px" />
<el-table-column fixed="right" label="操作" width="120px" v-if="selStock == null">
<template v-slot="scope">
@ -207,6 +211,21 @@ export default {
goodsIdQuery: '',
vehicleIdQuery: '',
locationIdQuery: '',
createTimeQuery: null,
shortcuts: [
{
text: '今天',
value: new Date(),
},
{
text: '昨天',
value: () => {
const date = new Date()
date.setTime(date.getTime() - 3600 * 1000 * 24)
return date
},
},
],
loading: true,
stockId: '',
stockFormRef: ref(),
@ -375,6 +394,7 @@ export default {
goodsId: this.goodsIdQuery.trim(),
vehicleId: this.vehicleIdQuery.trim(),
locationId: this.locationIdQuery.trim(),
createTime: timeFormatter(this.createTimeQuery),
userName: store.getters.getUserName
}
getAllStocks(request).then(res => {
@ -395,6 +415,7 @@ export default {
this.goodsIdQuery = ''
this.vehicleIdQuery = ''
this.locationIdQuery = ''
this.createTimeQuery = null
this.search()
},
getCurrentRow(row) {
@ -406,6 +427,7 @@ export default {
goodsId: this.goodsIdQuery.trim(),
vehicleId: this.vehicleIdQuery.trim(),
locationId: this.locationIdQuery.trim(),
createTime: timeFormatter(this.createTimeQuery),
userName: store.getters.getUserName
}
downloadStockExcel(params).then(res => {

View File

@ -9,6 +9,8 @@
:suffix-icon="Search" />
<el-select-v2 v-model="reasonQuery" style="width: 158px; margin-right: 10px;"
placeholder="请选择更新原因" :options="reasonOptions" @change="search()"></el-select-v2>
<el-date-picker v-model="updateTimeQuery" type="date" placeholder="选择完成日期" :shortcuts="shortcuts"
style="width: 158px; margin-right: 10px;" clearable />
<el-button type="primary" @click="search()">搜索</el-button>
<el-button type="warning" @click="reset()">重置</el-button>
</el-row>
@ -65,6 +67,21 @@ export default {
vehicleIdQuery: '',
goodsIdQuery: '',
reasonQuery: '',
updateTimeQuery: null,
shortcuts: [
{
text: '今天',
value: new Date(),
},
{
text: '昨天',
value: () => {
const date = new Date()
date.setTime(date.getTime() - 3600 * 1000 * 24)
return date
},
},
],
loading: true,
recordId: '',
reasonOptions: [
@ -127,6 +144,7 @@ export default {
vehicleId: this.vehicleIdQuery.trim(),
goodsId: this.goodsIdQuery.trim(),
reason: this.reasonQuery.trim(),
updateTime: timeFormatter(this.updateTimeQuery),
userName: store.getters.getUserName
}
getStockUpdateRecord(request).then(res => {
@ -150,6 +168,7 @@ export default {
this.vehicleIdQuery = ''
this.goodsIdQuery = ''
this.reasonQuery = ''
this.updateTimeQuery = null
this.search()
},
getCurrentRow(row) {