代码更新:

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 { export {
getAllStocks, 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 { export {
sendGoodsInTask, sendGoodsInTask,
sendGoodsOutTask, sendGoodsOutTask,
@ -198,5 +213,7 @@ export {
requestSortBox, requestSortBox,
getPickTasksByPage, getPickTasksByPage,
deletePickTasks, deletePickTasks,
updatePickTasks updatePickTasks,
clcNoPlan,
clcNoPlanConfirmBack
} }

View File

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