代码更新:
1. 增加盘点相关内容
This commit is contained in:
parent
ffac5ff1ab
commit
1a8296608e
31
src/api/inventory.js
Normal file
31
src/api/inventory.js
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import request from "@/http/request";
|
||||
|
||||
const inventoryOut = (params) => {
|
||||
return request({
|
||||
url: '/task/inventoryOut',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const getCurrentGoodsInventory = (params) => {
|
||||
return request({
|
||||
url: '/task/getCurrentGoodsInventory',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const inventoryConfirmBack = (params) => {
|
||||
return request({
|
||||
url: '/task/inventoryConfirmBack',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
inventoryOut,
|
||||
getCurrentGoodsInventory,
|
||||
inventoryConfirmBack
|
||||
}
|
||||
|
|
@ -121,16 +121,8 @@ export default {
|
|||
// vehicleType1Options: [],
|
||||
vehicleType2Options: [
|
||||
{
|
||||
value: 'CLC一箱一料',
|
||||
label: 'CLC一箱一料'
|
||||
},
|
||||
{
|
||||
value: 'CLC一箱两料',
|
||||
label: 'CLC一箱两料'
|
||||
},
|
||||
{
|
||||
value: 'No-CLC',
|
||||
label: 'No-CLC'
|
||||
value: '直接物料',
|
||||
label: '直接物料'
|
||||
},
|
||||
{
|
||||
value: '间接物料',
|
||||
|
|
@ -151,60 +143,8 @@ export default {
|
|||
vehicleType2ChangeHandle() {
|
||||
if (this.workFormEntity.vehicleType2 == '间接物料') {
|
||||
this.displayGoods = true
|
||||
// this.displayVehicleType1Selection = false
|
||||
// this.vehicleType1Options = [
|
||||
// {
|
||||
// value: 'FB02',
|
||||
// label: '分包1/2个料箱'
|
||||
// },
|
||||
// {
|
||||
// value: 'FB03',
|
||||
// label: '分包1/3个料箱'
|
||||
// },
|
||||
// {
|
||||
// value: 'FB04',
|
||||
// label: '分包1/4个料箱'
|
||||
// },
|
||||
// {
|
||||
// value: 'FB05',
|
||||
// label: '分包1/5个料箱'
|
||||
// },
|
||||
// {
|
||||
// value: 'FB06',
|
||||
// label: '分包1/6个料箱'
|
||||
// }
|
||||
// ]
|
||||
} else if (this.workFormEntity.vehicleType2 == 'CLC一箱一料') {
|
||||
this.displayGoods = false
|
||||
// this.displayVehicleType1Selection = false
|
||||
// this.vehicleType1Options = [
|
||||
// {
|
||||
// value: 'FC01',
|
||||
// label: '822整体1个'
|
||||
// }
|
||||
// ]
|
||||
} else if (this.workFormEntity.vehicleType2 == 'CLC一箱两料') {
|
||||
this.displayGoods = false
|
||||
// this.displayVehicleType1Selection = false
|
||||
// this.vehicleType1Options = [
|
||||
// {
|
||||
// value: 'LR01',
|
||||
// label: '810左右4个'
|
||||
// },
|
||||
// {
|
||||
// value: 'UD01',
|
||||
// label: '911上下2个'
|
||||
// }
|
||||
// ]
|
||||
} else {
|
||||
this.displayGoods = false
|
||||
// this.displayVehicleType1Selection = false
|
||||
// this.vehicleType1Options = [
|
||||
// {
|
||||
// value: 'FB01',
|
||||
// label: '分包1个料箱'
|
||||
// },
|
||||
// ]
|
||||
}
|
||||
},
|
||||
resetForms() {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
:suffix-icon="Search" />
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
<el-button type="warning" style="width: 201px; background-color: red; color: #000;" @click="setIndirect()">一键设置间接物料相关信息</el-button>
|
||||
<!-- <el-button type="warning" style="width: 201px; background-color: red; color: #000;" @click="setIndirect()">一键设置间接物料相关信息</el-button> -->
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button style="background-color: #00CED1; color: #000;"
|
||||
|
|
|
|||
|
|
@ -16,6 +16,22 @@
|
|||
<span class="station-no-text">{{ standId }}</span>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset class="goods-list-area">
|
||||
<legend>
|
||||
物料信息列表
|
||||
</legend>
|
||||
<el-table :data="inventoryGoodsDetails" stripe border max-height="200px"
|
||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column prop="goodsId" label="料号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="vehiclesQuantity" label="料箱数量" min-width="120px" />
|
||||
<el-table-column prop="vehicleIds" label="料箱号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="vehicleStatus" label="料箱状态" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="feedingWS" label="备料工位" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="lastFeedingMachineNo" label="最后一台备料机器序列号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="lastFeedingTime" label="备料最后一台车日期" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="isLack" label="是否缺料" min-width="120px" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</fieldset>
|
||||
<fieldset class="main-area">
|
||||
<legend>
|
||||
物料盘点
|
||||
|
|
@ -24,15 +40,10 @@
|
|||
label-width="150px" style="max-width: 100%" :rules="rules" status-icon>
|
||||
<div style="display: flex;">
|
||||
<div style="display: block; margin: 5px;">
|
||||
<!-- <div
|
||||
style="display: inline-flex; justify-content: center; height: 60px; width: 655px; margin: 5px; padding: 5px;">
|
||||
<UploadExcelPart></UploadExcelPart>
|
||||
</div> -->
|
||||
<div style="height: 50px; margin-bottom: 20px"><UploadExcelInventoryList></UploadExcelInventoryList></div>
|
||||
<div
|
||||
style="display: inline-flex; justify-content: center; height: 40px; width: 655px; margin: 5px; padding: 5px; background-color: #00AAE8;">
|
||||
style="display: inline-flex; justify-content: center; height: 40px; width: 430px; margin: 5px; padding: 5px; background-color: #00AAE8;">
|
||||
<span style="align-self: center; font-weight: bold;font-size: 25px;">
|
||||
{{ workFormEntity.tip }}
|
||||
输入完料号请按回车确认。
|
||||
</span>
|
||||
</div>
|
||||
<div style="display: flex;">
|
||||
|
|
@ -42,7 +53,7 @@
|
|||
</div>
|
||||
<div class="display-form-div">
|
||||
<el-input v-model="workFormEntity.goodsId" size="default" ref="goodsId"
|
||||
v-on:keyup.enter="getCurrentWorkInfo()" clearable></el-input>
|
||||
v-on:keyup.enter="getCurrentInvInfo()" clearable></el-input>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
|
|
@ -50,18 +61,57 @@
|
|||
<span class="display-title-text">箱号</span>
|
||||
</div>
|
||||
<div class="display-form-div">
|
||||
<el-input v-model="workFormEntity.vehicleId" size="default" ref="vehicleId"
|
||||
v-on:keyup.enter="getCurrentWorkInfo()" clearable></el-input>
|
||||
<el-input v-model="workFormEntity.vehicleId" size="default" ref="vehicleId" clearable></el-input>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin: 10px;">
|
||||
<div class="arrow" @click="invenOut()" style="height: 330px;">
|
||||
<span
|
||||
style="margin-left: 25px; align-self: center; font-weight: bold;font-size: 45px; writing-mode: vertical-lr;">请求盘点</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<fieldset class="main-area">
|
||||
<legend>
|
||||
盘点确认
|
||||
</legend>
|
||||
<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="changeFocus()"
|
||||
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 class="display-form-div">
|
||||
<el-input v-model="confirmFormEntity.goodsId" size="default"
|
||||
ref="confirmGoodsId" v-on:keyup.enter="changeFocus()"
|
||||
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 style="display: flex; margin-top: 20px;">
|
||||
<div class="display-form-div-left">
|
||||
<el-input-number v-model.number="workFormEntity.realNum" ref="realNum"
|
||||
controls-position="right" :min="0" />
|
||||
<el-input-number v-model.number="confirmFormEntity.confirmNum"
|
||||
ref="confirmNum" v-on:keyup.enter="changeFocus()" controls-position="right" :min="0" />
|
||||
</div>
|
||||
<div class="display-form-div-right">
|
||||
<span class="display-form-text-right">PC</span>
|
||||
|
|
@ -71,9 +121,9 @@
|
|||
</div>
|
||||
</div>
|
||||
<div style="margin: 10px;">
|
||||
<div class="arrow" @click="confirmTask()">
|
||||
<div class="arrow" @click="invenConfirm()" 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>
|
||||
|
|
@ -86,11 +136,11 @@
|
|||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { getWorkByStandAndGoods, confirmFinishWork, queryFinishByStandAndGoods } from '@/api/task'
|
||||
import { inventoryOut, getCurrentGoodsInventory, inventoryConfirmBack } from '@/api/inventory'
|
||||
import { replaceEnglishAndNumberIGAI } from '@/utils/formatter'
|
||||
import { reactive, ref } from 'vue'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import UploadExcelInventoryList from '@/excel/UploadExcelInventoryList.vue'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
</script>
|
||||
|
||||
|
|
@ -100,124 +150,110 @@ 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: ''
|
||||
vehicleId: ''
|
||||
}),
|
||||
rules: reactive({
|
||||
goodsId: [
|
||||
{ required: true, message: '请输入料号' }
|
||||
]
|
||||
}),
|
||||
inventoryGoodsDetails: [],
|
||||
confirmFormRef: ref(),
|
||||
confirmFormEntity: reactive({
|
||||
goodsId: '',
|
||||
vehicleId: '',
|
||||
confirmNum: null
|
||||
}),
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs.goodsId.focus()
|
||||
this.timer = setInterval(() => {
|
||||
this.queryFinish()
|
||||
}, 2000)
|
||||
},
|
||||
beforeUnmount() {
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
methods: {
|
||||
// 获取当前工作信息
|
||||
getCurrentWorkInfo() {
|
||||
const request = {
|
||||
standId: this.standId,
|
||||
goodsId: this.workFormEntity.goodsId
|
||||
}
|
||||
getWorkByStandAndGoods(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
|
||||
} else {
|
||||
this.resetForms()
|
||||
errorBox(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
this.resetForms()
|
||||
errorBox('查询工作信息错误')
|
||||
})
|
||||
},
|
||||
// 查询是否完成
|
||||
queryFinish() {
|
||||
// 获取当前盘点信息
|
||||
getCurrentInvInfo() {
|
||||
if (this.workFormEntity.goodsId == '') {
|
||||
return
|
||||
}
|
||||
const request = {
|
||||
standId: this.standId,
|
||||
goodsId: this.workFormEntity.goodsId
|
||||
goodsId: this.workFormEntity.goodsId,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
queryFinishByStandAndGoods(request).then(res => {
|
||||
getCurrentGoodsInventory(request).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)
|
||||
this.inventoryGoodsDetails = response.returnData
|
||||
} else {
|
||||
this.inventoryGoodsDetails = []
|
||||
errorBox(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
this.inventoryGoodsDetails = []
|
||||
errorBox('查询盘点信息错误。')
|
||||
})
|
||||
},
|
||||
// 重置参数
|
||||
resetForms() {
|
||||
resetWorkForms() {
|
||||
this.workFormEntity = reactive({
|
||||
goodsId: '',
|
||||
planPickNum: 0,
|
||||
remainNumOrigin: null,
|
||||
remainNumReal: null,
|
||||
remark: '',
|
||||
finishedRows: 0,
|
||||
totalRows: 0,
|
||||
finishedCounts: 0,
|
||||
totalCounts: 0,
|
||||
tip: ''
|
||||
vehicleId: ''
|
||||
})
|
||||
this.$refs.goodsId.focus()
|
||||
},
|
||||
resetConfirmForms() {
|
||||
this.confirmFormEntity = reactive({
|
||||
vehicleId: '',
|
||||
goodsId: '',
|
||||
confirmNum: null
|
||||
})
|
||||
this.$refs.confirmGoodsId.focus()
|
||||
},
|
||||
invenOut() {
|
||||
if (this.workFormEntity.goodsId == '') {
|
||||
errorBox('料号不可缺少')
|
||||
return
|
||||
}
|
||||
const request = {
|
||||
goodsId: this.workFormEntity.goodsId,
|
||||
vehicleId: this.confirmFormEntity.vehicleId,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
inventoryOut(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
this.resetWorkForms()
|
||||
ElMessage.success(response.message)
|
||||
} else {
|
||||
errorBox(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('下发盘点时发生异常。')
|
||||
})
|
||||
},
|
||||
// 确认完成工作
|
||||
confirmTask() {
|
||||
if (this.standId == '' || this.workFormEntity.goodsId == '') {
|
||||
errorBox('站台号和料号不可缺少')
|
||||
invenConfirm() {
|
||||
if (this.confirmFormEntity.goodsId == '' || this.confirmFormEntity.vehicleId == '' || this.confirmFormEntity.confirmNum == null || this.confirmFormEntity.confirmNum == '') {
|
||||
errorBox('料号、箱号、确认数量不可缺少。')
|
||||
return
|
||||
}
|
||||
const confirmParams = {
|
||||
standId: this.standId,
|
||||
goodsId: this.workFormEntity.goodsId,
|
||||
remainNumOrigin: this.workFormEntity.remainNumOrigin,
|
||||
remainNumReal: this.workFormEntity.remainNumReal
|
||||
goodsId: this.confirmFormEntity.goodsId,
|
||||
vehicleId: this.confirmFormEntity.vehicleId,
|
||||
confirmNum: this.confirmFormEntity.confirmNum,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
confirmFinishWork(confirmParams).then(res => {
|
||||
inventoryConfirmBack(confirmParams).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
if (response.returnData != null) {
|
||||
this.workFormEntity.tip = response.returnData.tip
|
||||
}
|
||||
this.resetForms()
|
||||
this.resetConfirmForms()
|
||||
ElMessage.success(response.message)
|
||||
} else {
|
||||
errorBox(response.message)
|
||||
|
|
@ -226,7 +262,22 @@ export default {
|
|||
console.log(err)
|
||||
errorBox('确认时发生异常')
|
||||
})
|
||||
},
|
||||
changeFocus() {
|
||||
this.confirmFormEntity.vehicleId = replaceEnglishAndNumberIGAI(this.confirmFormEntity.vehicleId)
|
||||
if (this.confirmFormEntity.vehicleId == '' || this.confirmFormEntity.vehicleId == null || this.confirmFormEntity.vehicleId == undefined) {
|
||||
this.$refs.confirmVehicleId.focus()
|
||||
return
|
||||
}
|
||||
if (this.confirmFormEntity.goodsId == '' || this.confirmFormEntity.goodsId == null || this.confirmFormEntity.goodsId == undefined) {
|
||||
this.$refs.confirmGoodsId.focus()
|
||||
return
|
||||
}
|
||||
if (this.confirmFormEntity.confirmNum == null || this.confirmFormEntity.confirmNum == undefined || this.confirmFormEntity.confirmNum == '') {
|
||||
this.$refs.confirmNum.focus()
|
||||
return
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -276,7 +327,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;
|
||||
|
|
@ -398,4 +449,16 @@ export default {
|
|||
font-weight: bold;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
.goods-list-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 90%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue
Block a user