增加入库物料信息扫码的格式化。

This commit is contained in:
梁州 2025-05-08 15:58:47 +08:00
parent eae7715ca4
commit ab65f82cf4
11 changed files with 484 additions and 390 deletions

View File

@ -10,3 +10,13 @@ export const getGoodsInfoByPage = (params) => {
data: params data: params
}) })
} }
/**
* 根据物料id查询物料信息
*/
export const getGoodsInfoByGoodsId = (params) => {
return request({
url: '/goods/getGoodsInfoByGoodsId',
method: 'get',
data: params
})
}

View File

@ -135,6 +135,7 @@ import {nextTick, onMounted, reactive, ref} from 'vue'
import {loading} from '@/utils/loading.js' import {loading} from '@/utils/loading.js'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs' import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import {labelPosition} from '@/constant/form' import {labelPosition} from '@/constant/form'
import {getGoodsInfoByGoodsId} from "@/api/goods";
const inTypeOptions = [ const inTypeOptions = [
{ {
@ -241,6 +242,24 @@ const changeFocus = () => {
if (inTaskEntity.goodsId === '') { if (inTaskEntity.goodsId === '') {
goodsId.value.focus() goodsId.value.focus()
return return
} else {
//
inTaskEntity.goodsId = inTaskEntity.goodsId.toUpperCase().trim()
if (inTaskEntity.goodsId.substring(0, 1) === 'P') {
//
loading.open('请求中,请稍等...')
getGoodsInfoByGoodsId(inTaskEntity.goodsId).then(res => {
const goodsResponse = res.data
if (goodsResponse.code !== 0) {
// P
inTaskEntity.goodsId = inTaskEntity.goodsId.substring(1)
}
}).catch(err => {
console.log(err)
}).finally(() => {
loading.close()
})
}
} }
if (inTaskEntity.opNum == null || inTaskEntity.opNum === '') { if (inTaskEntity.opNum == null || inTaskEntity.opNum === '') {
opNum.value.focus() opNum.value.focus()

View File

@ -1,381 +1,416 @@
<template> <template>
<el-config-provider :locale="zhCn"> <el-config-provider :locale="zhCn">
<el-container class="content"> <el-container class="content">
<div class="work-area"> <div class="work-area">
<fieldset class="search-area"> <fieldset class="search-area">
<el-form ref="outTaskRef" :model="outTaskEntity" :label-position="labelPosition" label-width="158px" <el-form ref="outTaskRef" :model="outTaskEntity" :label-position="labelPosition" label-width="158px"
style="max-width: 100%" :rules="requestRules" status-icon> style="max-width: 100%" :rules="requestRules" status-icon>
<div style="display: flex; justify-content: space-between;"> <div style="display: flex; justify-content: space-between;">
<el-row> <el-row>
<el-form-item label="出库类型" prop="outType"> <el-form-item label="出库类型" prop="outType">
<el-select-v2 style="width: 196px" v-model="outTaskEntity.outType" placeholder="请选择入库类型" <el-select-v2 style="width: 196px" v-model="outTaskEntity.outType" placeholder="请选择入库类型"
:options="outTypeOptions"></el-select-v2> :options="outTypeOptions"></el-select-v2>
</el-form-item> </el-form-item>
<el-form-item label="料号" prop="goodsId"> <el-form-item label="料号" prop="goodsId">
<el-input v-model="outTaskEntity.goodsId" ref="goodsId" clearable /> <el-input v-model="outTaskEntity.goodsId" ref="goodsId" clearable/>
</el-form-item> </el-form-item>
<el-form-item label="箱号" prop="vehicleId" v-if="outTaskEntity.outType != 9"> <el-form-item label="箱号" prop="vehicleId" v-if="outTaskEntity.outType != 9">
<el-input v-model="outTaskEntity.vehicleId" ref="vehicleId" clearable /> <el-input v-model="outTaskEntity.vehicleId" ref="vehicleId" clearable/>
</el-form-item> </el-form-item>
<el-form-item label="数量" prop="needNum"> <el-form-item label="数量" prop="needNum">
<el-input-number v-model.number="outTaskEntity.needNum" ref="needNum" <el-input-number style="width: 196px" v-model.number="outTaskEntity.needNum" ref="needNum"
controls-position="right" :min="1" clearable /> controls-position="right" :min="1" clearable/>
</el-form-item> </el-form-item>
<el-form-item label="原因" prop="reason" v-if="outTaskEntity.outType == 9"> <el-form-item label="原因" prop="reason" v-if="outTaskEntity.outType == 9">
<el-select-v2 style="width: 196px" v-model="outTaskEntity.reason" placeholder="请选择紧急出库原因" <el-select-v2 style="width: 196px" v-model="outTaskEntity.reason" placeholder="请选择紧急出库原因"
:options="resonOptions"></el-select-v2> :options="reasonOptions"></el-select-v2>
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row> <el-row>
<el-button type="primary" <el-button type="primary"
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;" style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
@click="confirmOut()">确认出库</el-button> @click="confirmOut()">确认出库
<el-button type="warning" </el-button>
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;" <el-button type="warning"
@click="clearInput()">清除输入</el-button> style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
</el-row> @click="clearInput()">清除输入
</div> </el-button>
</el-form> </el-row>
</fieldset>
<fieldset class="confirm-area">
<el-form ref="confirmRef" :model="confirmEntity" :label-position="labelPosition" label-width="158px"
style="max-width: 100%" :rules="confirmRules" status-icon>
<div style="display: flex; justify-content: space-between;">
<el-row>
<el-row style="border-bottom: dashed 1px black;">
<el-form-item label="出库类型" prop="outType">
<el-select-v2 v-model="confirmEntity.outType" placeholder=" "
:options="outTypeOptions" disabled></el-select-v2>
</el-form-item>
<el-form-item label="物料号" prop="goodsId">
<el-input v-model="confirmEntity.goodsId" disabled />
</el-form-item>
<el-form-item label="总需求" prop="totalNeed">
<el-input v-model="confirmEntity.totalNeed" disabled />
</el-form-item>
<el-form-item label="剩余需求" prop="remainNeed">
<el-input v-model="confirmEntity.remainNeed" disabled />
</el-form-item>
<el-form-item label="本次计划拣选" prop="planPickQty">
<el-input v-model="confirmEntity.planPickQty" disabled />
</el-form-item>
<el-form-item label="本次实际拣选" prop="realPickQty">
<el-input-number v-model.number="confirmEntity.realPickQty"
controls-position="right" :min="0" clearable @change="changePlanQty()" />
</el-form-item>
</el-row>
<el-row>
<el-form-item label="箱号" prop="vehicleId">
<el-input v-model="confirmEntity.vehicleId" disabled />
</el-form-item>
<el-form-item label="计划剩余数量" prop="planRemainQty">
<el-input v-model="confirmEntity.planRemainQty" disabled />
</el-form-item>
<el-form-item label="实际剩余数量" prop="realRemainQty">
<el-input-number v-model.number="confirmEntity.realRemainQty"
controls-position="right" :min="0" clearable />
</el-form-item>
</el-row>
</el-row>
<el-row>
<el-button type="success"
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
@click="confirmOrRelease()">确认/放行</el-button>
</el-row>
</div>
</el-form>
</fieldset>
</div> </div>
</el-container> </el-form>
</el-config-provider> </fieldset>
<fieldset class="confirm-area">
<el-form ref="confirmRef" :model="confirmEntity" :label-position="labelPosition" label-width="158px"
style="max-width: 100%" :rules="confirmRules" status-icon>
<div style="display: flex; justify-content: space-between;">
<el-row>
<el-row style="border-bottom: dashed 1px black;">
<el-form-item label="出库类型" prop="outType">
<el-select-v2 style="width: 196px" v-model="confirmEntity.outType" placeholder=" "
:options="outTypeOptions" disabled></el-select-v2>
</el-form-item>
<el-form-item label="物料号" prop="goodsId">
<el-input v-model="confirmEntity.goodsId" disabled/>
</el-form-item>
<el-form-item label="总需求" prop="totalNeed">
<el-input v-model="confirmEntity.totalNeed" disabled/>
</el-form-item>
<el-form-item label="剩余需求" prop="remainNeed">
<el-input v-model="confirmEntity.remainNeed" disabled/>
</el-form-item>
<el-form-item label="本次计划拣选" prop="planPickQty">
<el-input v-model="confirmEntity.planPickQty" disabled/>
</el-form-item>
<el-form-item label="本次实际拣选" prop="realPickQty">
<el-input-number style="width: 196px" v-model.number="confirmEntity.realPickQty"
controls-position="right" :min="0" clearable @change="changePlanQty()"/>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="箱号" prop="vehicleId">
<el-input v-model="confirmEntity.vehicleId" disabled/>
</el-form-item>
<el-form-item label="计划剩余数量" prop="planRemainQty">
<el-input v-model="confirmEntity.planRemainQty" disabled/>
</el-form-item>
<el-form-item label="实际剩余数量" prop="realRemainQty">
<el-input-number style="width: 196px" v-model.number="confirmEntity.realRemainQty"
controls-position="right" :min="0" clearable/>
</el-form-item>
</el-row>
</el-row>
<el-row>
<el-button type="success"
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
@click="confirmOrRelease()">确认/放行
</el-button>
</el-row>
</div>
</el-form>
</fieldset>
</div>
</el-container>
</el-config-provider>
</template> </template>
<script setup> <script setup>
import store from '@/store' import store from '@/store'
import { requireStockOut, getCurrentTask, confirmCurrentTask } from '@/api/task.js' import {requireStockOut, getCurrentTask, confirmCurrentTask} from '@/api/task.js'
import { errorBox, warningBox } from '@/utils/myMessageBox.js' import {errorBox, warningBox} from '@/utils/myMessageBox.js'
import { ElMessage } from 'element-plus' import {ElMessage} from 'element-plus'
import { reactive, ref } from 'vue' import {nextTick, onBeforeUnmount, onMounted, reactive, ref, watch} from 'vue'
import { loading } from '@/utils/loading' import {loading} from '@/utils/loading'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs' import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
</script> import {useRoute} from "vue-router";
import {labelPosition} from '@/constant/form'
<script> const STAND_ID = store.getters.getStandId
export default { const USER_NAME = store.getters.getUserName
name: 'goodsOut', let timer = ref()
data() { let outTaskRef = ref()
return { let outTaskEntity = reactive({
standId: store.getters.getStandId, outType: 9,
userName: store.getters.getUserName, goodsId: '',
timer: '', vehicleId: '',
labelPosition: 'top', reason: '',
outTaskRef: ref(), needNum: null
outTaskEntity: reactive({ })
outType: 9, const requestRules = reactive({
goodsId: '', outType: [
vehicleId: '', {required: true, message: '请选择入库类型'}
reason: '', ],
needNum: null needNum: [
}), {required: true, message: '请输入数量'},
requestRules: reactive({ {type: 'number', message: '请输入数字值'}
outType: [ ],
{ required: true, message: '请选择入库类型' } })
], const outTypeOptions = [
needNum: [ {
{ required: true, message: '请输入数量' }, label: '空箱出库',
{ type: 'number', message: '请输入数字值' } value: 1
], },
}), {
outTypeOptions: [ label: '紧急出库',
{ value: 9
label: '空箱出库', }
value: 1 ]
}, const reasonOptions = [
{ {
label: '紧急出库', label: '补料',
value: 9 value: '补料'
} },
], {
resonOptions: [ label: '少K',
{ value: '少K'
label: '补料', },
value: '补料' {
}, label: '缺料',
{ value: '缺料'
label: '少K', },
value: '少K' {
}, label: '返工工单',
{ value: '返工工单'
label: '缺料', }
value: '缺料' ]
}, let confirmRef = ref()
{ let confirmEntity = reactive({
label: '返工工单', taskId: '',
value: '返工工单' outType: null,
} goodsId: '',
], totalNeed: null,
confirmRef: ref(), remainNeed: null,
confirmEntity: reactive({}), planPickQty: null,
confirmRules: reactive({}), realPickQty: null,
pauseGetPickFlag: false, stockId: '',
} vehicleId: '',
}, planRemainQty: null,
mounted() { realRemainQty: null,
this.$nextTick(() => { isOut: null,
this.timer = setInterval(() => { putArea: '',
this.getTask() warningQty: null
}, 1000) })
}) const confirmRules = reactive({})
}, let pauseGetPickFlag = ref(false)
beforeUnmount() { const route = useRoute()//
clearInterval(this.timer) //
}, onMounted(() => {
methods: { nextTick(() => {
// timer.value = setInterval(() => {
clearInput() { timerTask_1()
this.outTaskEntity = reactive({ }, 1000)
outType: 9, })
goodsId: '', })
vehicleId: '', onBeforeUnmount(() => {
needNum: null clearInterval(timer.value)
}) })
}, //
// watch(() => route.path, (newVal, oldVal) => {
confirmOut() { if (newVal === '/goodsOut') {
if (this.outTaskEntity.needNum == null) { timer.value = setInterval(() => {
errorBox('请输入正确的数量。') timerTask_1()
return }, 1000)
} } else {
if (this.outTaskEntity.outType != 1) { clearInterval(timer.value)
if (this.outTaskEntity.goodsId == '') { }
errorBox('非空箱出库时,请输入料号。') })
return // 1
} const timerTask_1 = () => {
} getTask()
if (this.outTaskEntity.outType == 9) { }
if (this.outTaskEntity.reason == '') { //
errorBox('紧急出库请选择原因。') const getTask = () => {
return if (pauseGetPickFlag.value) {
} return
} }
const request = { const request = {
outType: this.outTaskEntity.outType, standId: STAND_ID,
goodsId: this.outTaskEntity.goodsId.toUpperCase(), userName: USER_NAME
vehicleId: this.outTaskEntity.vehicleId, }
needNum: this.outTaskEntity.needNum, //
reason: this.outTaskEntity.reason, getCurrentTask(request).then(res => {
destination: this.standId, const response = res.data
userName: this.userName, if (response.code === 0) {
standId: this.standId const confirmVo = response.data
} // form
loading.open('请求中,请稍等...') confirmEntity.taskId = confirmVo.taskConfirm.taskId
requireStockOut(request).then(res => { confirmEntity.outType = confirmVo.taskConfirm.outType
const response = res.data confirmEntity.goodsId = confirmVo.taskConfirm.goodsId
if (response.code == 0) { confirmEntity.totalNeed = confirmVo.taskConfirm.totalNeed
// confirmEntity.remainNeed = confirmVo.taskConfirm.remainNeed
ElMessage.success(response.message) confirmEntity.planPickQty = confirmVo.taskConfirm.planPickQty
this.clearInput() confirmEntity.realPickQty = confirmVo.taskConfirm.realPickQty
} else { confirmEntity.stockId = confirmVo.stockConfirm.stockId
errorBox(response.message) confirmEntity.vehicleId = confirmVo.stockConfirm.vehicleId
} confirmEntity.planRemainQty = confirmVo.stockConfirm.planRemainQty
}).catch(err => { confirmEntity.realRemainQty = confirmVo.stockConfirm.realRemainQty
console.log(err) confirmEntity.isOut = confirmVo.stockConfirm.isOut
errorBox('请求错误。') confirmEntity.putArea = confirmVo.stockConfirm.putArea
}).finally(() => { confirmEntity.warningQty = confirmVo.stockConfirm.warningQty
loading.close() pauseGetPickFlag.value = true
}) //
}, if (confirmEntity.isOut === 0 && confirmEntity.planRemainQty <= confirmEntity.warningQty) {
// warningBox('剩余数量低于预警值,请清点库存数量。')
getTask() { }
if (this.pauseGetPickFlag) { } else if (response.code === 400) {
return //
} pauseGetPickFlag.value = true
const request = { warningBox(response.message)
standId: this.standId,
userName: this.userName
}
//
getCurrentTask(request).then(res => {
const response = res.data
if (response.code == 0) {
const confirmVo = response.data
// form
this.confirmEntity = {
taskId: confirmVo.taskConfirm.taskId,
outType: confirmVo.taskConfirm.outType,
goodsId: confirmVo.taskConfirm.goodsId,
totalNeed: confirmVo.taskConfirm.totalNeed,
remainNeed: confirmVo.taskConfirm.remainNeed,
planPickQty: confirmVo.taskConfirm.planPickQty,
realPickQty: confirmVo.taskConfirm.realPickQty,
stockId: confirmVo.stockConfirm.stockId,
vehicleId: confirmVo.stockConfirm.vehicleId,
planRemainQty: confirmVo.stockConfirm.planRemainQty,
realRemainQty: confirmVo.stockConfirm.realRemainQty,
isOut: confirmVo.stockConfirm.isOut,
putArea: confirmVo.stockConfirm.putArea,
warningQty: confirmVo.stockConfirm.warningQty
}
this.pauseGetPickFlag = true
//
if (this.confirmEntity.isOut == 0 && this.confirmEntity.planRemainQty <= this.confirmEntity.warningQty) {
warningBox('剩余数量低于预警值,请清点库存数量。')
}
} else if (response.code == 400) {
//
this.pauseGetPickFlag = true
warningBox(response.message)
}
}).catch(err => {
console.log(err)
this.pauseGetPickFlag = true
errorBox('请求错误,请检查完原因后刷新界面。')
})
},
// /
confirmOrRelease() {
// ---
const request = {
taskConfirm: {
taskId: this.confirmEntity.taskId,
outType: this.confirmEntity.outType,
goodsId: this.confirmEntity.goodsId,
totalNeed: this.confirmEntity.totalNeed,
remainNeed: this.confirmEntity.remainNeed,
planPickQty: this.confirmEntity.planPickQty,
realPickQty: this.confirmEntity.realPickQty,
},
stockConfirm: {
stockId: this.confirmEntity.stockId,
vehicleId: this.confirmEntity.vehicleId,
goodsId: this.confirmEntity.goodsId,
planRemainQty: this.confirmEntity.planRemainQty,
realRemainQty: this.confirmEntity.realRemainQty,
isOut: this.confirmEntity.isOut,
putArea: this.confirmEntity.putArea,
},
standId: this.standId,
userName: this.userName
}
confirmCurrentTask(request).then(res => {
const response = res.data
if (response.code == 0) {
// form
this.confirmEntity = reactive({})
this.pauseGetPickFlag = false
ElMessage.success(response.message)
} else if (response.code == 400) {
this.pauseGetPickFlag = false
warningBox(response.message)
} else {
//
errorBox(response.message)
}
}).catch(err => {
console.log(err)
errorBox('请求错误,请检查完原因后刷新界面。')
})
},
//
changePlanQty() {
if (this.confirmEntity.isOut == 0 && this.confirmEntity.realPickQty != this.confirmEntity.planPickQty) {
//
const changeQty = this.confirmEntity.realPickQty - this.confirmEntity.planPickQty
//
this.confirmEntity.realRemainQty = this.confirmEntity.planRemainQty - changeQty
}
}
} }
}).catch(err => {
console.log(err)
pauseGetPickFlag.value = true
errorBox('请求错误,请检查完原因后刷新界面。')
})
}
//
const clearInput = () => {
outTaskEntity.outType = 9
outTaskEntity.goodsId = ''
outTaskEntity.vehicleId = ''
outTaskEntity.needNum = null
}
//
const confirmOut = () => {
if (outTaskEntity.needNum == null) {
errorBox('请输入正确的数量。')
return
}
if (outTaskEntity.outType !== 1) {
if (outTaskEntity.goodsId === '') {
errorBox('非空箱出库时,请输入料号。')
return
}
}
if (outTaskEntity.outType === 9) {
if (outTaskEntity.reason === '') {
errorBox('紧急出库请选择原因。')
return
}
}
const request = {
outType: outTaskEntity.outType,
goodsId: outTaskEntity.goodsId.toUpperCase().trim(),
vehicleId: outTaskEntity.vehicleId.toUpperCase().trim(),
needNum: outTaskEntity.needNum,
reason: outTaskEntity.reason,
destination: STAND_ID,
userName: USER_NAME,
standId: STAND_ID
}
loading.open('请求中,请稍等...')
requireStockOut(request).then(res => {
const response = res.data
if (response.code === 0) {
//
ElMessage.success(response.message)
clearInput()
} else {
errorBox(response.message)
}
}).catch(err => {
console.log(err)
errorBox('请求错误。')
}).finally(() => {
loading.close()
})
}
// /
const confirmOrRelease = () => {
// ---
const request = {
taskConfirm: {
taskId: confirmEntity.taskId,
outType: confirmEntity.outType,
goodsId: confirmEntity.goodsId,
totalNeed: confirmEntity.totalNeed,
remainNeed: confirmEntity.remainNeed,
planPickQty: confirmEntity.planPickQty,
realPickQty: confirmEntity.realPickQty,
},
stockConfirm: {
stockId: confirmEntity.stockId,
vehicleId: confirmEntity.vehicleId,
goodsId: confirmEntity.goodsId,
planRemainQty: confirmEntity.planRemainQty,
realRemainQty: confirmEntity.realRemainQty,
isOut: confirmEntity.isOut,
putArea: confirmEntity.putArea,
},
standId: STAND_ID,
userName: USER_NAME
}
confirmCurrentTask(request).then(res => {
const response = res.data
if (response.code === 0) {
// form
clearConfirmEntity()
pauseGetPickFlag.value = false
ElMessage.success(response.message)
} else if (response.code === 400) {
pauseGetPickFlag.value = false
warningBox(response.message)
} else {
//
errorBox(response.message)
}
}).catch(err => {
console.log(err)
errorBox('请求错误,请检查完原因后刷新界面。')
})
}
//
const changePlanQty = () => {
if (confirmEntity.isOut === 0 && confirmEntity.realPickQty !== confirmEntity.planPickQty) {
//
confirmEntity.realRemainQty = confirmEntity.planRemainQty - confirmEntity.realPickQty + confirmEntity.planPickQty
}
}
// confirmEntity
const clearConfirmEntity = () => {
confirmEntity.taskId = ''
confirmEntity.outType = null
confirmEntity.goodsId = ''
confirmEntity.totalNeed = null
confirmEntity.remainNeed = null
confirmEntity.planPickQty = null
confirmEntity.realPickQty = null
confirmEntity.stockId = ''
confirmEntity.vehicleId = ''
confirmEntity.planRemainQty = null
confirmEntity.realRemainQty = null
confirmEntity.isOut = null
confirmEntity.putArea = ''
confirmEntity.warningQty = null
} }
</script> </script>
<style scoped> <style scoped>
.content { .content {
display: flex; display: flex;
width: 100%; width: 100%;
} }
.work-area { .work-area {
width: 100%; width: 100%;
/* padding: 5px; */ /* padding: 5px; */
} }
.search-area { .search-area {
margin: auto; margin: auto;
min-height: fit-content; min-height: fit-content;
max-height: 90%; max-height: 90%;
margin-bottom: 10px; margin-bottom: 10px;
min-width: inherit; min-width: inherit;
border: solid 1px; border: solid 1px;
border-radius: 10px; border-radius: 10px;
box-shadow: 0px 15px 10px -15px #000; box-shadow: 0px 15px 10px -15px #000;
overflow: auto; overflow: auto;
padding: 10px; padding: 10px;
} }
.confirm-area { .confirm-area {
margin: auto; margin: auto;
min-height: fit-content; min-height: fit-content;
max-height: 90%; max-height: 90%;
margin-bottom: 10px; margin-bottom: 10px;
min-width: inherit; min-width: inherit;
border: solid 1px; border: solid 1px;
border-radius: 10px; border-radius: 10px;
box-shadow: 0px 15px 10px -15px #000; box-shadow: 0px 15px 10px -15px #000;
overflow: auto; overflow: auto;
padding: 10px; padding: 10px;
} }
.el-form-item { .el-form-item {
margin: 10px 5px 10px 5px; margin: 10px 5px 10px 5px;
} }
.el-form-item .el-input { .el-form-item .el-input {
width: 196px; width: 196px;
} }
.table-class { .table-class {
margin: 5px 5px 5px 5px; margin: 5px 5px 5px 5px;
width: inherit; width: inherit;
} }
</style> </style>

View File

@ -46,7 +46,7 @@
<el-input v-model="confirmEntity.stockNum" disabled/> <el-input v-model="confirmEntity.stockNum" disabled/>
</el-form-item> </el-form-item>
<el-form-item label="确认数量" prop="confirmNum"> <el-form-item label="确认数量" prop="confirmNum">
<el-input-number v-model.number="confirmEntity.confirmNum" <el-input-number style="width: 196px" v-model.number="confirmEntity.confirmNum"
controls-position="right" :min="0" clearable/> controls-position="right" :min="0" clearable/>
</el-form-item> </el-form-item>
</el-row> </el-row>

View File

@ -100,7 +100,7 @@
<el-input v-model="confirmEntity.planPickQty" disabled/> <el-input v-model="confirmEntity.planPickQty" disabled/>
</el-form-item> </el-form-item>
<el-form-item label="实际拣选数量" prop="realPickQty"> <el-form-item label="实际拣选数量" prop="realPickQty">
<el-input-number v-model.number="confirmEntity.realPickQty" <el-input-number style="width: 196px" v-model.number="confirmEntity.realPickQty"
controls-position="right" :min="0" clearable @change="changePlanQty()"/> controls-position="right" :min="0" clearable @change="changePlanQty()"/>
</el-form-item> </el-form-item>
</el-row> </el-row>
@ -111,11 +111,11 @@
<el-form-item label="存放区域" prop="putArea"> <el-form-item label="存放区域" prop="putArea">
<el-input v-model="confirmEntity.putArea" disabled/> <el-input v-model="confirmEntity.putArea" disabled/>
</el-form-item> </el-form-item>
<el-form-item label="计划剩余数量" prop="planRemainQty" v-if="confirmEntity.isOut != 1"> <el-form-item label="计划剩余数量" prop="planRemainQty" v-if="confirmEntity.isOut !== 1">
<el-input v-model="confirmEntity.planRemainQty" disabled/> <el-input v-model="confirmEntity.planRemainQty" disabled/>
</el-form-item> </el-form-item>
<el-form-item label="实际剩余数量" prop="realRemainQty" v-if="confirmEntity.isOut != 1"> <el-form-item label="实际剩余数量" prop="realRemainQty" v-if="confirmEntity.isOut !== 1">
<el-input-number v-model.number="confirmEntity.realRemainQty" <el-input-number style="width: 196px" v-model.number="confirmEntity.realRemainQty"
controls-position="right" :min="0" clearable/> controls-position="right" :min="0" clearable/>
</el-form-item> </el-form-item>
</el-row> </el-row>
@ -319,7 +319,7 @@ onBeforeUnmount(() => {
}) })
// //
watch(() => route.path, (newVal, oldVal) => { watch(() => route.path, (newVal, oldVal) => {
if (newVal == '/kitting') { if (newVal === '/kitting') {
timer.value = setInterval(() => { timer.value = setInterval(() => {
timerTask_1() timerTask_1()
}, 1000) }, 1000)
@ -331,7 +331,7 @@ watch(() => route.path, (newVal, oldVal) => {
} }
}) })
watch(() => workFormEntity.workOrder, (newVal, oldVal) => { watch(() => workFormEntity.workOrder, (newVal, oldVal) => {
if (newVal == '') { if (newVal === '') {
workFormEntity.productIdOrigin = '' workFormEntity.productIdOrigin = ''
workFormEntity.productId = '' workFormEntity.productId = ''
workFormEntity.singleProductId = '' workFormEntity.singleProductId = ''
@ -340,20 +340,20 @@ watch(() => workFormEntity.workOrder, (newVal, oldVal) => {
} }
}) })
watch(() => workFormEntity.productId, (newVal, oldVal) => { watch(() => workFormEntity.productId, (newVal, oldVal) => {
if (newVal != oldVal) { if (newVal !== oldVal) {
workFormEntity.singleProductId = '' workFormEntity.singleProductId = ''
workFormEntity.boxNo = '' workFormEntity.boxNo = ''
workFormEntity.goodsId = '' workFormEntity.goodsId = ''
} }
}) })
watch(() => workFormEntity.singleProductId, (newVal, oldVal) => { watch(() => workFormEntity.singleProductId, (newVal, oldVal) => {
if (newVal != oldVal) { if (newVal !== oldVal) {
workFormEntity.boxNo = '' workFormEntity.boxNo = ''
workFormEntity.goodsId = '' workFormEntity.goodsId = ''
} }
}) })
watch(() => workFormEntity.boxNo, (newVal, oldVal) => { watch(() => workFormEntity.boxNo, (newVal, oldVal) => {
if (newVal != oldVal) { if (newVal !== oldVal) {
workFormEntity.goodsId = '' workFormEntity.goodsId = ''
} }
}) })
@ -368,23 +368,23 @@ const timerTask_1 = () => {
} }
// //
const solveEnterKey = (e) => { const solveEnterKey = (e) => {
if (e.key.toLocaleLowerCase() == 'enter') { if (e.key.toLowerCase() === 'enter') {
confirmReleaseBtn.value.$el.click() confirmReleaseBtn.value.$el.click()
} }
} }
// options // options
const initWorkOptions = () => { const initWorkOptions = () => {
const request = { const request = {
workOrder: workFormQuery.workOrder != '' ? workFormQuery.workOrder : workFormEntity.workOrder, workOrder: workFormQuery.workOrder !== '' ? workFormQuery.workOrder : workFormEntity.workOrder,
singleProductId: workFormQuery.singleProductId != '' ? workFormQuery.singleProductId : workFormEntity.singleProductId, singleProductId: workFormQuery.singleProductId !== '' ? workFormQuery.singleProductId : workFormEntity.singleProductId,
boxNo: workFormQuery.boxNo != '' ? workFormQuery.boxNo : workFormEntity.boxNo, boxNo: workFormQuery.boxNo !== '' ? workFormQuery.boxNo : workFormEntity.boxNo,
goodsId: workFormQuery.goodsId != '' ? workFormQuery.goodsId : workFormEntity.goodsId, goodsId: workFormQuery.goodsId !== '' ? workFormQuery.goodsId : workFormEntity.goodsId,
planStartDate: dateFormatter(workFormEntity.planStartDate) planStartDate: dateFormatter(workFormEntity.planStartDate)
} }
optionLoading.value = true optionLoading.value = true
queryKateWorks(request).then(res => { queryKateWorks(request).then(res => {
const response = res.data const response = res.data
if (response.code == 0) { if (response.code === 0) {
workOptions.workOrder = response.data.workOrder workOptions.workOrder = response.data.workOrder
// //
workFormEntity.productIdOrigin = response.data.productIdOrigin workFormEntity.productIdOrigin = response.data.productIdOrigin
@ -434,7 +434,7 @@ const confirmStart = () => {
loading.open() loading.open()
initWorks(request).then(res => { initWorks(request).then(res => {
const response = res.data const response = res.data
if (response.code == 0) { if (response.code === 0) {
ElMessage.success(response.message) ElMessage.success(response.message)
setTimeout(() => { setTimeout(() => {
showBoxSummary() showBoxSummary()
@ -463,7 +463,7 @@ const showBoxSummary = () => {
} }
getBoxesAndLacks(request).then(res => { getBoxesAndLacks(request).then(res => {
const response = res.data const response = res.data
if (response.code == 0) { if (response.code === 0) {
const boxDetailVo = response.data const boxDetailVo = response.data
// //
getPrintTabs(boxDetailVo.boxSummary) getPrintTabs(boxDetailVo.boxSummary)
@ -496,7 +496,7 @@ const getWork = () => {
} }
getCurrentWorks(request).then(res => { getCurrentWorks(request).then(res => {
const response = res.data const response = res.data
if (response.code == 0) { if (response.code === 0) {
// form // form
confirmEntity.workIndex = response.data.orderConfirm.workIndex confirmEntity.workIndex = response.data.orderConfirm.workIndex
confirmEntity.workOrder = response.data.orderConfirm.workOrder confirmEntity.workOrder = response.data.orderConfirm.workOrder
@ -515,10 +515,10 @@ const getWork = () => {
confirmEntity.warningQty = response.data.stockConfirm.warningQty confirmEntity.warningQty = response.data.stockConfirm.warningQty
pauseGetWorkFlag.value = true pauseGetWorkFlag.value = true
// //
if (confirmEntity.isOut == 0 && confirmEntity.planRemainQty <= confirmEntity.warningQty) { if (confirmEntity.isOut === 0 && confirmEntity.planRemainQty <= confirmEntity.warningQty) {
warningBox('剩余数量低于预警值,请清点库存数量。') warningBox('剩余数量低于预警值,请清点库存数量。')
} }
} else if (response.code == 400) { } else if (response.code === 400) {
// //
pauseGetWorkFlag.value = true pauseGetWorkFlag.value = true
warningBox(response.message) warningBox(response.message)
@ -543,17 +543,17 @@ const getWork = () => {
} }
// //
const ifNeedShowBoxSummary = () => { const ifNeedShowBoxSummary = () => {
if (storeKittingWork.workOrder != '') { if (storeKittingWork.workOrder !== '') {
// //
if (confirmEntity.workOrder != storeKittingWork.workOrder if (confirmEntity.workOrder !== storeKittingWork.workOrder
|| confirmEntity.productId != storeKittingWork.productId || confirmEntity.productId !== storeKittingWork.productId
|| confirmEntity.singleProductId != storeKittingWork.singleProductId || confirmEntity.singleProductId !== storeKittingWork.singleProductId
|| confirmEntity.boxNo != storeKittingWork.boxNo) { || confirmEntity.boxNo !== storeKittingWork.boxNo) {
printLacks(storeKittingWork.workOrder, storeKittingWork.productId, storeKittingWork.singleProductId, storeKittingWork.boxNo) printLacks(storeKittingWork.workOrder, storeKittingWork.productId, storeKittingWork.singleProductId, storeKittingWork.boxNo)
if (confirmEntity.workOrder == '') { if (confirmEntity.workOrder === '') {
// //
successBox('当前工单已完成。') successBox('当前工单已完成。')
} else if (confirmEntity.boxNo != storeKittingWork.boxNo) { } else if (confirmEntity.boxNo !== storeKittingWork.boxNo) {
// //
showBoxSummary() showBoxSummary()
} }
@ -599,11 +599,11 @@ const confirmOrRelease = () => {
} }
confirmCurrentWork(request).then(res => { confirmCurrentWork(request).then(res => {
const response = res.data const response = res.data
if (response.code == 0) { if (response.code === 0) {
// form // form
resetConfirmEntity() resetConfirmEntity()
ElMessage.success(response.message) ElMessage.success(response.message)
} else if (response.code == 400) { } else if (response.code === 400) {
// form // form
resetConfirmEntity() resetConfirmEntity()
// //
@ -633,7 +633,7 @@ const resetConfirmEntity = () => {
} }
// //
const changePlanQty = () => { const changePlanQty = () => {
if (confirmEntity.isOut == 0 && confirmEntity.realPickQty != confirmEntity.planPickQty) { if (confirmEntity.isOut === 0 && confirmEntity.realPickQty !== confirmEntity.planPickQty) {
// //
const changeQty = confirmEntity.realPickQty - confirmEntity.planPickQty const changeQty = confirmEntity.realPickQty - confirmEntity.planPickQty
// //
@ -648,7 +648,7 @@ const requestPrint = () => {
// //
const getPrintTabs = (boxSummary) => { const getPrintTabs = (boxSummary) => {
printTabs.value = [] printTabs.value = []
if (boxSummary != undefined) { if (boxSummary !== undefined) {
for (let i = 1; i <= boxSummary.boxQty; i++) { for (let i = 1; i <= boxSummary.boxQty; i++) {
printTabs.value.push( printTabs.value.push(
{ {
@ -675,7 +675,7 @@ const searchKittingGoods = () => {
request.boxNo = confirmEntity.boxNo request.boxNo = confirmEntity.boxNo
queryWorkingGoodsByPage(request).then(res => { queryWorkingGoodsByPage(request).then(res => {
const response = res.data const response = res.data
if (response.code == 0) { if (response.code === 0) {
const data = response.data const data = response.data
if (data != null) { if (data != null) {
currentBoxGoodsList.value = data.lists currentBoxGoodsList.value = data.lists
@ -695,7 +695,7 @@ const handleSortChange = (data) => {
if (baseTableQuery.sortBy.has(data.prop)) { if (baseTableQuery.sortBy.has(data.prop)) {
baseTableQuery.sortBy.delete(data.prop) baseTableQuery.sortBy.delete(data.prop)
} }
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending') baseTableQuery.sortBy.set(data.prop, data.order.toLowerCase() === 'ascending')
searchKittingGoods() searchKittingGoods()
} }
// //
@ -710,7 +710,7 @@ const printLacks = (workOrder, productId, singleProductId, boxNo) => {
} }
getLackGoods(request).then(res => { getLackGoods(request).then(res => {
const response = res.data const response = res.data
if (response.code == 0) { if (response.code === 0) {
lackGoodsForPrint.value = response.data lackGoodsForPrint.value = response.data
nextTick(() => { nextTick(() => {
printLackGoodsBtn.value.click() printLackGoodsBtn.value.click()

View File

@ -112,7 +112,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="任务类型"> <el-form-item label="任务类型">
<el-select-v2 v-model="rowEditFormEntity.taskType" placeholder="请选择任务类型" <el-select-v2 style="width: 196px" v-model="rowEditFormEntity.taskType" placeholder="请选择任务类型"
:options="taskTypeOptions" disabled></el-select-v2> :options="taskTypeOptions" disabled></el-select-v2>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -120,7 +120,7 @@
<el-row :gutter="16"> <el-row :gutter="16">
<el-col :span="12" :offset="0"> <el-col :span="12" :offset="0">
<el-form-item label="任务状态"> <el-form-item label="任务状态">
<el-select-v2 v-model="rowEditFormEntity.taskStatus" placeholder="请选择任务状态" <el-select-v2 style="width: 196px" v-model="rowEditFormEntity.taskStatus" placeholder="请选择任务状态"
:options="wmsTaskStatusOptions"></el-select-v2> :options="wmsTaskStatusOptions"></el-select-v2>
</el-form-item> </el-form-item>
</el-col> </el-col>

View File

@ -28,4 +28,14 @@ public class GoodsController {
public WmsApiResponse<PageVo<GoodsVo>> getGoodsInfoByPage(@RequestBody GoodsQuery goodsQuery) { public WmsApiResponse<PageVo<GoodsVo>> getGoodsInfoByPage(@RequestBody GoodsQuery goodsQuery) {
return goodsControllerService.getGoodsInfoByPage(goodsQuery); return goodsControllerService.getGoodsInfoByPage(goodsQuery);
} }
/**
* 根据物料id查询物料信息
* @param goodsId 查询参数
* @return 查询结果
*/
@GetMapping("/getGoodsInfoByGoodsId")
public WmsApiResponse<GoodsVo> getGoodsInfoByGoodsId(@RequestParam("goodsId") String goodsId) {
return goodsControllerService.getGoodsInfoByGoodsId(goodsId);
}
} }

View File

@ -15,5 +15,12 @@ public interface IGoodsControllerService {
* @param goodsQuery 查询参数 * @param goodsQuery 查询参数
* @return 查询结果 * @return 查询结果
*/ */
WmsApiResponse<PageVo<GoodsVo>> getGoodsInfoByPage(@RequestBody GoodsQuery goodsQuery); WmsApiResponse<PageVo<GoodsVo>> getGoodsInfoByPage(GoodsQuery goodsQuery);
/**
* 根据物料id获取物料信息
* @param goodsId 物料id
* @return 物料信息
*/
WmsApiResponse<GoodsVo> getGoodsInfoByGoodsId(String goodsId);
} }

View File

@ -41,4 +41,21 @@ public class GoodsControllerServiceImpl implements IGoodsControllerService {
PageVo<GoodsVo> pageVo = PageVo.of(goodsPage, GoodsVo::of); PageVo<GoodsVo> pageVo = PageVo.of(goodsPage, GoodsVo::of);
return WmsApiResponse.success("查询成功", pageVo); return WmsApiResponse.success("查询成功", pageVo);
} }
/**
* 根据物料id查询物料信息
* @param goodsId 物料id
* @return 查询结果
*/
@Override
public WmsApiResponse<GoodsVo> getGoodsInfoByGoodsId(String goodsId) {
if (StringUtils.isEmpty(goodsId)) {
return WmsApiResponse.error("请求参数不能为空。", null);
}
TAppGoods targetGoods = goodsService.getById(goodsId);
if (targetGoods == null) {
return WmsApiResponse.error("查询结果为空。", null);
}
return WmsApiResponse.success("查询成功。", GoodsVo.of(targetGoods));
}
} }

View File

@ -110,7 +110,6 @@ public class LoginControllerServiceImpl implements ILoginControllerService {
} }
List<MenuVo> menuVoList = new LinkedList<>(); List<MenuVo> menuVoList = new LinkedList<>();
// 查找一级菜单 // 查找一级菜单
// TODO 这里可以用递归优化减少代码量
for (TSysMenu firstMenu : menuPoList) { for (TSysMenu firstMenu : menuPoList) {
if (AppConstant.ROOT_MENU_ID.equals(firstMenu.getParentId())) {// 查找到所有的一级子菜单 if (AppConstant.ROOT_MENU_ID.equals(firstMenu.getParentId())) {// 查找到所有的一级子菜单
MenuVo tempFirstMenu = new MenuVo(); MenuVo tempFirstMenu = new MenuVo();

View File

@ -182,18 +182,15 @@ public class TaskOperationControllerServiceImpl implements ITaskOperationControl
* @param wmsTaskRequest 请求信息 * @param wmsTaskRequest 请求信息
*/ */
private void updateDetailInfoExceptStatus(TAppTask targetTask, WmsTaskRequest wmsTaskRequest) { private void updateDetailInfoExceptStatus(TAppTask targetTask, WmsTaskRequest wmsTaskRequest) {
targetTask.setTaskType(wmsTaskRequest.getTaskType());
targetTask.setTaskPriority(wmsTaskRequest.getTaskPriority()); targetTask.setTaskPriority(wmsTaskRequest.getTaskPriority());
targetTask.setVehicleId(wmsTaskRequest.getVehicleId());
targetTask.setOrigin(wmsTaskRequest.getOrigin()); targetTask.setOrigin(wmsTaskRequest.getOrigin());
targetTask.setDestination(wmsTaskRequest.getDestination()); targetTask.setDestination(wmsTaskRequest.getDestination());
targetTask.setWcsTaskId(wmsTaskRequest.getWcsTaskId()); targetTask.setWcsTaskId(wmsTaskRequest.getWcsTaskId());
targetTask.setGoodsId(wmsTaskRequest.getGoodsId()); targetTask.setGoodsId(wmsTaskRequest.getGoodsId());
targetTask.setOpNum(wmsTaskRequest.getOpNum()); targetTask.setOpNum(wmsTaskRequest.getOpNum());
targetTask.setStockNum(wmsTaskRequest.getStockNum()); targetTask.setStockNum(wmsTaskRequest.getStockNum());
targetTask.setOpUser(wmsTaskRequest.getOpUser()); targetTask.setOpUser(wmsTaskRequest.getUserName());
targetTask.setRemark(wmsTaskRequest.getRemark()); targetTask.setRemark(wmsTaskRequest.getRemark());
targetTask.setCallStand(wmsTaskRequest.getCallStand());
targetTask.setGoodsDesc(wmsTaskRequest.getGoodsDesc()); targetTask.setGoodsDesc(wmsTaskRequest.getGoodsDesc());
} }
} }