11/7 货架管理1.1

20240912_adapter
wangwei 8 months ago
parent 0d36b097f4
commit ffa895c74b

@ -16,6 +16,7 @@
<el-col :span="12" class="el-col"> <el-col :span="12" class="el-col">
<el-form-item label="货架说明:" class="query-form-item"> <el-form-item label="货架说明:" class="query-form-item">
<el-input <el-input
:disabled="remarkStatus"
v-model="formData.remark" style="width: 80%" v-model="formData.remark" style="width: 80%"
auto-complete="off" auto-complete="off"
placeholder="请输入货架名称" placeholder="请输入货架名称"
@ -27,6 +28,7 @@
<el-col :span="12" class="el-col"> <el-col :span="12" class="el-col">
<el-form-item label="所属工位:" class="query-form-item" prop="workPlaceIdFk"> <el-form-item label="所属工位:" class="query-form-item" prop="workPlaceIdFk">
<el-select <el-select
disabled
v-model="formData.workPlaceIdFk" v-model="formData.workPlaceIdFk"
filterable filterable
remote remote
@ -132,6 +134,7 @@ import {
updateWorkplaceFreight updateWorkplaceFreight
} from '@/api/basic/workPlace/SysWorkplaceFreight' } from '@/api/basic/workPlace/SysWorkplaceFreight'
import { getLayerCode, getLayerList, saveLayer } from '@/api/basic/workPlace/SysWorkplaceLayer' import { getLayerCode, getLayerList, saveLayer } from '@/api/basic/workPlace/SysWorkplaceLayer'
import { isBlank } from '@/utils/strUtil'
export default { export default {
props: { props: {
@ -142,15 +145,19 @@ export default {
rowData: { rowData: {
type: Object, type: Object,
required: true required: true
},
workplaceId: {
type: Object,
required: true
} }
}, },
data() { data() {
return { return {
formData: { formData: {
code: "", code: '',
name: "", name: '',
remark: "", remark: '',
workPlaceIdFk: "", workPlaceIdFk: ''
}, },
freightData: null, freightData: null,
workPlaces: [], workPlaces: [],
@ -160,17 +167,17 @@ export default {
// ], // ],
workPlaceIdFk: [ workPlaceIdFk: [
{ required: true, message: '请选择所属工位', trigger: 'blur' } { required: true, message: '请选择所属工位', trigger: 'blur' }
], ]
}, },
LayerQuery: { LayerQuery: {
page: 1, page: 1,
limit: 10, limit: 10,
freightCode:"" freightCode: ''
}, },
layerList: [], layerList: [],
saveStatus: false, // saveStatus: false, //
addStatus: false, //
selectedIndex: null,// selectedIndex: null,//
remarkStatus: false,
// { // {
// code:null, // code:null,
// queueNum:null, // queueNum:null,
@ -189,18 +196,18 @@ export default {
} }
filterWorkOptimize(query) filterWorkOptimize(query)
.then((response) => { .then((response) => {
this.workPlaces = response.data || []; this.workPlaces = response.data || []
}) })
.catch(() => { .catch(() => {
this.options.getWorkPlaceList = []; this.options.getWorkPlaceList = []
}); })
}, },
getCode() { getCode() {
createFreightCode().then(res => { createFreightCode().then(res => {
if (res.code == 20000) { if (res.code == 20000) {
this.formData.code = res.data this.formData.code = res.data
} else { } else {
this.formData = "" this.formData = ''
} }
}) })
}, },
@ -211,7 +218,7 @@ export default {
if (this.rowData != null) { if (this.rowData != null) {
updateWorkplaceFreight(this.formData).then(res => { updateWorkplaceFreight(this.formData).then(res => {
if (res.code == 20000) { if (res.code == 20000) {
this.$message.success("更新成功") this.$message.success('更新成功')
this.closeDialog() this.closeDialog()
} else { } else {
this.$message.error(res.message) this.$message.error(res.message)
@ -220,7 +227,7 @@ export default {
} else { } else {
addWorkplaceFreight(this.formData).then(res => { addWorkplaceFreight(this.formData).then(res => {
if (res.code == 20000) { if (res.code == 20000) {
this.$message.success("新增成功") this.$message.success('新增成功')
this.closeDialog() this.closeDialog()
} else { } else {
this.$message.error(res.message) this.$message.error(res.message)
@ -237,24 +244,47 @@ export default {
// //
addWorkplaceLayer() { addWorkplaceLayer() {
if(this.addStatus == true ){ if (isBlank(this.formData.remark)){
this.$message.error('请先保存当摆货层在进行添加') return this.$message.error('请输入货架说明')
return }
if (this.saveStatus == true){
return this.$message.error('请完成编辑摆货层')
} }
//
if (this.layerList.length == 0) {
getLayerCode({ freightCode: this.formData.code }).then(res => { getLayerCode({ freightCode: this.formData.code }).then(res => {
if (res.code == 20000) { if (res.code == 20000) {
this.layerList.push({ this.layerList.push({
code: res.data, code: res.data,
queueNum: null, queueNum: null
freightCode:this.formData.code,
workPlaceIdFk:this.formData.code.workPlaceIdFk,
remark:this.formData.remark
}) })
} else { } else {
this.$message.error("系统繁忙") this.$message.error('系统繁忙')
} }
}) })
this.addStatus = true } else {
//
let lastLayer = this.layerList[this.layerList.length - 1]
if (lastLayer.queueNum == null || lastLayer.queueNum == 0) {
return this.$message.error('请编辑上层摆货层出货槽数量')
}
let code = this.createLayerCode(lastLayer)
this.layerList.push({
code: code,
queueNum: null
})
}
// this.addStatus = true
},
createLayerCode(lastLayer) {
let code
code = lastLayer.code.replace(this.formData.code, '')
code = parseInt(code, 10) + 1
let incrementedValue = code.toString().padStart(2, '0')
code = this.formData.code + incrementedValue
return code
}, },
// //
handleEdit(index, val) { handleEdit(index, val) {
@ -267,14 +297,18 @@ export default {
}, },
handleSave(row) { handleSave(row) {
if (row.queueNum == null || row.queueNum == 0) { if (row.queueNum == null || row.queueNum == 0) {
return this.$message.error("请输入出货槽数量") return this.$message.error('请输入出货槽数量')
} }
row.freightCode = this.formData.code
row.workPlaceIdFk = this.formData.workPlaceIdFk
row.remark = this.formData.remark
this.remarkStatus = true
saveLayer(row).then(res => { saveLayer(row).then(res => {
if (res.code == 20000){ if (res.code == 20000){
this.selectedIndex = null this.selectedIndex = null
this.saveStatus = false this.saveStatus = false
this.closeDialog() // this.closeDialog()
this.$message.success("新增成功!") this.$message.success("保存成功!")
} }
}) })
}, },
@ -287,7 +321,7 @@ export default {
this.layerList = [] this.layerList = []
} }
}) })
}, }
}, },
created() { created() {
if (this.rowData != null) { if (this.rowData != null) {
@ -295,9 +329,10 @@ export default {
this.formData.workPlaceIdFk = String(this.rowData.workPlaceIdFk) this.formData.workPlaceIdFk = String(this.rowData.workPlaceIdFk)
this.getLayers() this.getLayers()
} else { } else {
this.formData.workPlaceIdFk = String(this.workplaceId)
this.getCode() this.getCode()
} }
this.findWorkPlace("") this.findWorkPlace('')
} }
} }

@ -1,16 +1,19 @@
<template> <template>
<div> <div>
<!--<el-card class="el-card">--> <!--<el-card class="el-card">-->
<div style="display: flex;margin-top: 20px;width: 100%;height: 100%"> <div style="display: flex;width: 100%;height: 100%">
<!--<div style="display: flex;width: 20%;height: 130%">--> <!--<div style="display: flex;width: 20%;height: 130%">-->
<div style="width: 45%;height: 340px;margin-bottom: 10px"> <div style="width: 45%;height: 340px;margin-bottom: 10px">
<el-card style="width: 100%;height: 100%"> <el-card style="width: 100%;height: 100%">
<div slot="header" class="clearfix" style="margin-bottom: 10px;"> <div slot="header" class="clearfix" style="margin-bottom: 10px;">
<span style="font-weight: 700;">取货架列表</span> <span style="font-weight: 700;">取货架列表
</div> <el-button style="float: right;margin-bottom: -5px " @click="onAddFreight" type="primary">新增取货架
<el-button style="float: right; margin-bottom: 5px" @click="onAddFreight" type="primary">新增取货架
</el-button> </el-button>
</span>
</div>
<el-table <el-table
:data="freightList" :data="freightList"
:row-style="{ height: '32px' }" :row-style="{ height: '32px' }"
@ -61,19 +64,14 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<!--<pagination-->
<!-- :total="total"-->
<!-- :limit.sync="query.limit"-->
<!-- :page.sync="query.page"-->
<!-- @pagination="getList"-->
<!--&gt;-->
<!--</pagination>-->
<el-pagination <el-pagination
layout="prev, pager, next" style="width: 100px"
style="float: right"
small small
:total="queueTotal" @current-change="handleFreightCurrentChange"
> :current-page.sync="query.page"
:page-size="query.limit"
layout="total,prev, pager, next"
:total="total">
</el-pagination> </el-pagination>
</el-card> </el-card>
</div> </div>
@ -112,11 +110,13 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination
layout="prev, pager, next" style="width: 100px"
style="float: right"
small small
:total="LayerTotal" @current-change="handleLayerCurrentChange"
> :current-page.sync="LayerQuery.page"
:page-size="LayerQuery.limit"
layout="prev, pager, next"
:total="LayerTotal">
</el-pagination> </el-pagination>
<!--<pagination--> <!--<pagination-->
<!-- :total="LayerTotal"--> <!-- :total="LayerTotal"-->
@ -146,12 +146,19 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination
layout="prev, pager, next"
style="float: right"
small small
:total="queueTotal" @current-change="handleQueueCurrentChange"
> :current-page.sync="queueQuery.page"
:page-size="queueQuery.limit"
layout="prev, pager, next"
:total="queueTotal">
</el-pagination> </el-pagination>
<!--<el-pagination-->
<!-- layout="prev, pager, next"-->
<!-- style="float: right"-->
<!-- small-->
<!--&gt;-->
<!--</el-pagination>-->
</el-card> </el-card>
</div> </div>
</div> </div>
@ -163,11 +170,12 @@
v-if="WorkplaceFreightDialogVisible" v-if="WorkplaceFreightDialogVisible"
:close-on-press-escape="false" :close-on-press-escape="false"
:close-on-click-modal="false" :close-on-click-modal="false"
@close="" @close="closeDialog"
> >
<addWorkplaceFreightDialog <addWorkplaceFreightDialog
:closeDialog="closeDialog" :closeDialog="closeDialog"
:rowData="rowData" :rowData="rowData"
:workplaceId="workplaceId"
> >
</addWorkplaceFreightDialog> </addWorkplaceFreightDialog>
</el-dialog> </el-dialog>
@ -256,6 +264,18 @@ export default {
} }
}) })
}, },
handleFreightCurrentChange(newPage){
this.query.page = newPage
this.getList()
},
handleQueueCurrentChange(newPage){
this.queueQuery.page = newPage
this.getQueues()
},
handleLayerCurrentChange(newPage){
this.LayerQuery.page = newPage
this.getLayers()
},
handChangeFreight(row) { handChangeFreight(row) {
this.LayerQuery.freightCode = row.code this.LayerQuery.freightCode = row.code
this.getLayers() this.getLayers()

Loading…
Cancel
Save