代码更新:

1. 增加非计划领料功能
This commit is contained in:
梁州 2024-09-03 21:12:47 +08:00
parent 9b415b9ecc
commit 4a1b753506
3 changed files with 163 additions and 200 deletions

View File

@ -16,7 +16,16 @@ const updateStockInfo = (params) => {
})
}
const getStockNumByGoodsId = (params) => {
return request({
url: '/stock/getStockNumByGoodsId',
method: 'post',
data: params
})
}
export {
getAllStocks,
updateStockInfo
updateStockInfo,
getStockNumByGoodsId
}

View File

@ -176,6 +176,21 @@ const updatePickTasks = (params) => {
})
}
const clcNoPlan = (params) => {
return request({
url: '/task/clcNoPlan',
method: 'post',
data: params
})
}
const clcNoPlanConfirmBack = (params) => {
return request({
url: '/task/clcNoPlanConfirmBack',
method: 'post',
data: params
})
}
export {
sendGoodsInTask,
sendGoodsOutTask,
@ -198,5 +213,7 @@ export {
requestSortBox,
getPickTasksByPage,
deletePickTasks,
updatePickTasks
updatePickTasks,
clcNoPlan,
clcNoPlanConfirmBack
}

View File

@ -30,8 +30,8 @@
<span class="display-title-text">料号</span>
</div>
<div class="display-form-div">
<el-input v-model="workFormEntity.goodsId" size="default" ref="goodsId"
@blur="getCurrentWorkInfo()" clearable></el-input>
<el-input v-model="workFormEntity.goodsId" size="default" ref="needGoodsId"
@blur="getStockNumOfGoodsIdMethod()" clearable></el-input>
</div>
</div>
<div style="display: flex; flex-direction: column;">
@ -40,8 +40,8 @@
</div>
<div style="display: flex; margin-top: 20px;">
<div class="display-form-div-left">
<el-input-number v-model.number="workFormEntity.planPickNum"
controls-position="right" :min="0" width="200px" disabled />
<el-input-number v-model.number="workFormEntity.stockNum"
controls-position="right" :min="0" disabled />
</div>
<div class="display-form-div-right">
<span class="display-form-text-right">PC</span>
@ -54,7 +54,7 @@
</div>
<div style="display: flex; margin-top: 20px;">
<div class="display-form-div-left">
<el-input-number v-model.number="workFormEntity.remainNumReal"
<el-input-number v-model.number="workFormEntity.needNum"
controls-position="right" :min="0" />
</div>
<div class="display-form-div-right">
@ -64,56 +64,58 @@
</div>
</div>
<div style="display: flex; margin-top: 15px">
<!-- <div
style="display: inline-flex; justify-content: center; width: 160px; margin: 5px; padding: 5px; background-color: #CCCCCC;">
<span style="align-self: center; font-weight: bold;font-size: 25px;">工单</span>
</div> -->
<div
style="display: inline-flex; justify-content: center; width: 120px; margin: 5px; padding: 5px; background-color: #00AAE8;">
style="display: inline-flex; justify-content: center; width: 80px; height: 149px; margin: 5px; padding: 5px; background-color: #CCCCCC;">
<span
style="align-self: center; font-weight: bold;font-size: 25px;">领料<br />原因</span>
</div>
<div>
<div style="display: flex">
<div
style="display: inline-flex; justify-content: center; width: 127px; margin: 5px; padding: 5px; background-color: #00AAE8;">
<span style="align-self: center; font-weight: bold;font-size: 25px;">
工单#
</span>
</div>
<div
style="display: inline-flex; justify-content: center; width: 400px; margin: 5px; padding: 5px; background-color: #00AAE8;">
<el-input v-model="workFormEntity.goodsId" size="default" ref="goodsId"
@blur="getCurrentWorkInfo()" clearable></el-input>
style="display: inline-flex; justify-content: center; width: 410px; margin: 5px; padding: 5px; background-color: #00AAE8;">
<el-input v-model="workFormEntity.workOrder" size="default"
clearable></el-input>
</div>
</div>
<div style="display: flex; margin-top: 5px; margin-top: 15px">
<div style="display: flex; margin-top: 5px">
<div
style="display: inline-flex; justify-content: center; width: 160px; margin: 5px; padding: 5px; background-color: #CCCCCC;">
<span
style="align-self: center; font-weight: bold;font-size: 20px;">当前进度</span>
</div>
<div
style="display: inline-flex; justify-content: center; width: 240px; margin: 5px; padding: 5px; background-color: #CCCCCC;">
<span style="align-self: center; font-weight: bold;font-size: 20px;">
{{ workFormEntity.finishedRows + '/' + workFormEntity.totalRows }}
style="display: inline-flex; justify-content: center; width: 127px; margin: 5px; padding: 5px; background-color: #00AAE8;">
<span style="align-self: center; font-weight: bold;font-size: 25px;">
小车号
</span>
</div>
<div
style="display: inline-flex; justify-content: center; width: 80px; margin: 5px; padding: 5px; background-color: #CCCCCC;">
<span style="align-self: center; font-weight: bold;font-size: 20px;"></span>
style="display: inline-flex; justify-content: center; width: 410px; margin: 5px; padding: 5px; background-color: #00AAE8;">
<el-input v-model="workFormEntity.smallVehicleNo" size="default"
clearable></el-input>
</div>
</div>
<div style="display: flex; margin-top: 5px">
<div
style="display: inline-flex; justify-content: center; width: 240px; margin: 5px; padding: 5px; background-color: #CCCCCC;">
<span style="align-self: center; font-weight: bold;font-size: 20px;">
{{ workFormEntity.finishedCounts + '/' + workFormEntity.totalCounts }}
style="display: inline-flex; justify-content: center; width: 127px; margin: 5px; padding: 5px; background-color: #00AAE8;">
<span style="align-self: center; font-weight: bold;font-size: 25px;">
描述
</span>
</div>
<div
style="display: inline-flex; justify-content: center; width: 80px; margin: 5px; padding: 5px; background-color: #CCCCCC;">
<span style="align-self: center; font-weight: bold;font-size: 20px;">
PC
</span>
style="display: inline-flex; justify-content: center; width: 410px; margin: 5px; padding: 5px; background-color: #00AAE8;">
<el-input v-model="workFormEntity.callReason" size="default"
clearable></el-input>
</div>
</div>
</div>
</div>
</div>
<div style="margin: 10px;">
<div class="arrow" @click="confirmTask()">
<div class="arrow" @click="createTask()" style="height: 454px;">
<span
style="margin-left: 25px; align-self: center; font-weight: bold;font-size: 45px; writing-mode: vertical-lr;">完成确认</span>
style="margin-left: 25px; align-self: center; font-weight: bold;font-size: 45px; writing-mode: vertical-lr;">请求确认</span>
</div>
</div>
</div>
@ -123,109 +125,51 @@
<legend>
领料确认
</legend>
<el-form ref="workFormRef" :model="workFormEntity" :label-position="labelPosition"
<el-form ref="confirmFormRef" :model="confirmFormEntity" :label-position="labelPosition"
label-width="150px" style="max-width: 100%" :rules="rules" status-icon>
<div style="display: flex;">
<div style="display: block; margin: 5px;">
<div style="display: flex;">
<div style="display: flex; flex-direction: column;">
<div class="display-title-div">
<span class="display-title-text">箱号</span>
</div>
<div class="display-form-div">
<el-input v-model="confirmFormEntity.vehicleId" size="default"
ref="confirmVehicleId" v-on:keyup.enter="getCurrentGoodsPickNumMethod()"
clearable></el-input>
</div>
</div>
<div style="display: flex; flex-direction: column;">
<div class="display-title-div">
<span class="display-title-text">料号</span>
</div>
<div class="display-form-div">
<el-input v-model="workFormEntity.goodsId" size="default" ref="goodsId"
v-on:keyup.enter="getCurrentWorkInfo()" clearable></el-input>
<el-input v-model="confirmFormEntity.goodsId" size="default"
ref="confirmGoodsId" v-on:keyup.enter="getCurrentGoodsPickNumMethod()"
clearable></el-input>
</div>
</div>
<div style="display: flex; flex-direction: column;">
<div class="display-title-div">
<span class="display-title-text">计划拣选数量</span>
<span class="display-title-text">领料数量</span>
</div>
<div style="display: flex; margin-top: 20px;">
<div class="display-form-div-left">
<el-input-number v-model.number="workFormEntity.planPickNum"
controls-position="right" :min="0" width="200px" disabled />
<el-input-number v-model.number="confirmFormEntity.realPickNum"
ref="confirmRealPickNum" controls-position="right" :min="0" />
</div>
<div class="display-form-div-right">
<span class="display-form-text-right">PC</span>
</div>
</div>
</div>
<div style="display: flex; flex-direction: column;">
<div class="display-title-div">
<span class="display-title-text">理论剩余数量</span>
</div>
<div style="display: flex; margin-top: 20px;">
<div class="display-form-div-left">
<el-input-number v-model.number="workFormEntity.remainNumOrigin"
controls-position="right" :min="0" disabled />
</div>
<div class="display-form-div-right">
<span class="display-form-text-right">PC</span>
</div>
</div>
</div>
<div style="display: flex; flex-direction: column;">
<div class="display-title-div">
<span class="display-title-text">实际剩余数量</span>
</div>
<div style="display: flex; margin-top: 20px;">
<div class="display-form-div-left">
<el-input-number v-model.number="workFormEntity.remainNumReal"
controls-position="right" :min="0" />
</div>
<div class="display-form-div-right">
<span class="display-form-text-right">PC</span>
</div>
</div>
</div>
</div>
<div style="display: flex; margin-top: 15px">
<div
style="display: inline-flex; justify-content: center; width: 160px; margin: 5px; padding: 5px; background-color: #CCCCCC;">
<span style="align-self: center; font-weight: bold;font-size: 25px;">备注</span>
</div>
<div
style="display: inline-flex; justify-content: center; width: 700px; margin: 5px; padding: 5px; background-color: #00AAE8;">
<span style="align-self: center; font-weight: bold;font-size: 25px;">
{{ workFormEntity.remark }}
</span>
</div>
</div>
<div style="display: flex; margin-top: 5px; margin-top: 15px">
<div
style="display: inline-flex; justify-content: center; width: 160px; margin: 5px; padding: 5px; background-color: #CCCCCC;">
<span
style="align-self: center; font-weight: bold;font-size: 20px;">当前进度</span>
</div>
<div
style="display: inline-flex; justify-content: center; width: 240px; margin: 5px; padding: 5px; background-color: #CCCCCC;">
<span style="align-self: center; font-weight: bold;font-size: 20px;">
{{ workFormEntity.finishedRows + '/' + workFormEntity.totalRows }}
</span>
</div>
<div
style="display: inline-flex; justify-content: center; width: 80px; margin: 5px; padding: 5px; background-color: #CCCCCC;">
<span style="align-self: center; font-weight: bold;font-size: 20px;"></span>
</div>
<div
style="display: inline-flex; justify-content: center; width: 240px; margin: 5px; padding: 5px; background-color: #CCCCCC;">
<span style="align-self: center; font-weight: bold;font-size: 20px;">
{{ workFormEntity.finishedCounts + '/' + workFormEntity.totalCounts }}
</span>
</div>
<div
style="display: inline-flex; justify-content: center; width: 80px; margin: 5px; padding: 5px; background-color: #CCCCCC;">
<span style="align-self: center; font-weight: bold;font-size: 20px;">
PC
</span>
</div>
</div>
</div>
<div style="margin: 10px;">
<div class="arrow" @click="confirmTask()">
<div class="arrow" @click="confirmPick()" style="height: 270px;">
<span
style="margin-left: 25px; align-self: center; font-weight: bold;font-size: 45px; writing-mode: vertical-lr;">完成确认</span>
style="margin-left: 25px; align-self: center; font-weight: bold;font-size: 45px; writing-mode: vertical-lr;">回库确认</span>
</div>
</div>
</div>
@ -238,7 +182,8 @@
<script setup>
import store from '@/store'
import { getWorkByStandAndGoods, confirmFinishWork, queryFinishByStandAndGoods } from '@/api/task'
import { clcNoPlan, clcNoPlanConfirmBack } from '@/api/task'
import { getStockNumByGoodsId } from '@/api/stock'
import { reactive, ref } from 'vue'
import { ElMessage } from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
@ -250,20 +195,21 @@ export default {
data() {
return {
standId: store.getters.getStandId,
timer: '',
labelPosition: 'top',
workFormRef: ref(),
workFormEntity: reactive({
goodsId: '',
planPickNum: 0,
remainNumOrigin: null,
remainNumReal: null,
remark: '',
finishedRows: 0,
totalRows: 0,
finishedCounts: 0,
totalCounts: 0,
tip: ''
stockNum: null,
needNum: null,
workOrder: '',
smallVehicleNo: '',
callReason: ''
}),
confirmFormRef: ref(),
confirmFormEntity: reactive({
vehicleId: '',
goodsId: '',
realPickNum: null
}),
rules: reactive({
goodsId: [
@ -273,76 +219,40 @@ export default {
}
},
mounted() {
this.$refs.goodsId.focus()
this.timer = setInterval(() => {
this.queryFinish()
}, 2000)
},
beforeUnmount() {
clearInterval(this.timer)
},
methods: {
//
getCurrentWorkInfo() {
//
getStockNumOfGoodsIdMethod() {
const request = {
standId: this.standId,
goodsId: this.workFormEntity.goodsId,
userName: store.getters.getUserName
}
getWorkByStandAndGoods(request).then(res => {
getStockNumByGoodsId(request).then(res => {
const response = res.data
if (response.code == 0) {
this.workFormEntity.goodsId = response.returnData.goodsId
this.workFormEntity.planPickNum = response.returnData.planPickNum
this.workFormEntity.remainNumOrigin = response.returnData.remainNumOrigin
this.workFormEntity.remainNumReal = response.returnData.remainNumReal
this.workFormEntity.remark = response.returnData.remark
this.workFormEntity.finishedRows = response.returnData.finishedRows
this.workFormEntity.totalRows = response.returnData.totalRows
this.workFormEntity.finishedCounts = response.returnData.finishedCounts
this.workFormEntity.totalCounts = response.returnData.totalCounts
this.workFormEntity.tip = response.returnData.tip
this.workFormEntity.stockNum = response.returnData.remainNum
} else {
this.resetForms()
this.workFormEntity.stockNum = 0
ElMessage.error(response.message)
}
}).catch(err => {
console.log(err)
this.resetForms()
ElMessage.error('查询工作信息错误')
this.workFormEntity.stockNum = null
ElMessage.error('查询库存余量发生错误。')
})
},
//
queryFinish() {
if (this.workFormEntity.goodsId == '') {
return
getCurrentGoodsPickNumMethod() {
if (this.confirmFormEntity.vehicleId == '' || this.confirmFormEntity.vehicleId == null | undefined) {
this.$refs.confirmVehicleId.focus()
}
const request = {
standId: this.standId,
goodsId: this.workFormEntity.goodsId
if (this.confirmFormEntity.goodsId == '' || this.confirmFormEntity.goodsId == null | undefined) {
this.$refs.confirmGoodsId.focus()
}
queryFinishByStandAndGoods(request).then(res => {
const response = res.data
if (response.code == 0) {
if (response.returnData != null && response.returnData.tip != '') {
this.workFormEntity.tip = response.returnData.tip
ElMessage({
message: response.returnData.tip,
type: 'warning',
showClose: true
})
} else {
ElMessage({
message: response.message,
type: 'success',
showClose: true
})
if (this.confirmFormEntity.realPickNum == null | undefined) {
this.$refs.confirmRealPickNum.focus()
}
this.resetForms()
}
}).catch(err => {
console.log(err)
})
},
//
resetForms() {
@ -361,7 +271,38 @@ export default {
this.$refs.goodsId.focus()
},
//
confirmTask() {
createTask() {
if (this.standId == '' || this.workFormEntity.goodsId == '') {
ElMessage({
message: '站台号和料号不可缺少',
type: 'error',
})
return
}
const requestParams = {
goodsId: '',
stockNum: null,
needNum: null,
workOrder: '',
smallVehicleNo: '',
callReason: '',
standId: this.standId,
userName: store.getters.getUserName
}
clcNoPlan(requestParams).then(res => {
const response = res.data
if (response.code == 0) {
ElMessage.success(response.message)
} else {
ElMessage.error(response.message)
}
}).catch(err => {
console.log(err)
ElMessage.error('请求时发生异常。')
})
},
//
confirmPick() {
if (this.standId == '' || this.workFormEntity.goodsId == '') {
ElMessage({
message: '站台号和料号不可缺少',
@ -372,26 +313,22 @@ export default {
const confirmParams = {
standId: this.standId,
goodsId: this.workFormEntity.goodsId,
remainNumOrigin: this.workFormEntity.remainNumOrigin,
remainNumReal: this.workFormEntity.remainNumReal,
vehicleId: this.workFormEntity.vehicleId,
realPickNum: this.workFormEntity.realPickNum,
userName: store.getters.getUserName
}
confirmFinishWork(confirmParams).then(res => {
clcNoPlanConfirmBack(confirmParams).then(res => {
const response = res.data
if (response.code == 0) {
if (response.returnData != null) {
this.workFormEntity.tip = response.returnData.tip
}
this.resetForms()
ElMessage.success(response.message)
} else {
ElMessage.error(response.message)
}
}).catch(err => {
console.log(err)
ElMessage.error('确认时发生异常')
ElMessage.error('确认时发生异常')
})
}
},
}
}
</script>
@ -421,7 +358,7 @@ export default {
.title-area {
display: flex;
/* min-height: 80px; */
/* min-height: 10%; */
max-height: max-content;
margin-bottom: 10px;
min-width: inherit;
@ -441,7 +378,7 @@ export default {
#309330 50%,
#309330 100%) bottom right;
background-size: 100% 50%;
height: 400px;
/* height: 400px; */
width: 250px;
background-repeat: no-repeat;
display: inline-flex;