11/6 货架1.0

20240912_adapter
wangwei 5 months ago
parent da5fd400b3
commit 4889e7ce26

@ -0,0 +1,27 @@
import axios from "@/utils/request";
import request from "@/utils/request";
export function getLayerCode(query) {
return axios({
url: "/udiwms/WorkplaceLayer/createCodeByFreightCode",
method: "get",
params: query
});
}
export function saveLayer(query) {
return axios({
url: "/udiwms/WorkplaceLayer/save",
method: "post",
data: query
});
}
export function getLayerList(query) {
return axios({
url: "/udiwms/WorkplaceLayer/getLayerPage",
method: "get",
params: query
});
}

@ -71,9 +71,9 @@ export function addLayer(query) {
});
}
export function getQueueListByFreightCode(query) {
export function getQueueListPage(query) {
return axios({
url: "/udiwms/sysWorkplaceQueue/getQueueListByFreightCode",
url: "/udiwms/sysWorkplaceQueue/getQueueList",
method: "get",
params: query
});

@ -14,9 +14,9 @@
</el-form-item>
</el-col>
<el-col :span="12" class="el-col">
<el-form-item label="货架名称:" class="query-form-item" prop="name">
<el-form-item label="货架说明:" class="query-form-item">
<el-input
v-model="formData.name" style="width: 80%"
v-model="formData.remark" style="width: 80%"
auto-complete="off"
placeholder="请输入货架名称"
></el-input>
@ -43,26 +43,84 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="12" class="el-col">
<el-form-item label="备注:" prop="remake" class="query-form-item">
<el-input
v-model="formData.remark" style="width: 80%"
auto-complete="off"
></el-input>
</el-form-item>
</el-col>
</el-row>
<!--<el-row :gutter="24">-->
<!-- <el-col :span="12" class="el-col">-->
<!-- <el-form-item label="备注:" prop="remake" class="query-form-item">-->
<!-- <el-input-->
<!-- v-model="formData.remark" style="width: 80%"-->
<!-- auto-complete="off"-->
<!-- ></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!--</el-row>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click.native="hideForm">取消</el-button>
<el-button
type="primary"
@click.native="formSubmit()"
>提交
</el-button
>
<div style="float: right;margin-bottom: 10px">
<el-button-group>
<el-button type="primary" icon="el-icon-plus" @click="addWorkplaceLayer"></el-button>
</el-button-group>
</div>
<el-table v-loading="loading" :data="layerList" style="width: 100%" :row-style="{height: '32px' }"
highlight-current-row @current-change="handCurrentChange"
>
<el-table-column type="index" label="序号"></el-table-column>
<el-table-column label="摆货层编号" prop="code" ></el-table-column>
<el-table-column label="出货槽数量" prop="queueNum">
<template slot-scope="scope">
<div style="display: flex; justify-content: center; align-items: center; width: 100%;">
<el-input
size="small"
v-model="scope.row.queueNum"
style="width: 100%"
type="number"
:disabled="scope.$index !== selectedIndex"
></el-input>
</div>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="100">
<template slot-scope="scope">
<!--<el-button-->
<!-- type="text"-->
<!-- size="small"-->
<!-- @click.native.stop="handleEdit(scope.row)"-->
<!--&gt;编辑-->
<!--</el-button>-->
<el-button type="text" size="small" v-if="scope.$index == selectedIndex " @click.stop="true"
@click.native="handleSave(scope.row)"
>保存
</el-button>
<el-button
type="text"
size="small"
v-if="scope.$index != selectedIndex "
@click.stop="true"
@click.native="handleEdit(scope.$index,scope.row)"
>编辑
</el-button>
<el-button
type="text"
size="small"
@click.native.stop="handleDel(scope.row)"
>删除
</el-button
>
</template>
</el-table-column>
<!--<el-table-column label="货架名称" prop="name" ></el-table-column>-->
<!--<el-table-column label="创建时间" prop="createTime" ></el-table-column>-->
<!--<el-table-column label="备注" prop="remark"></el-table-column>-->
</el-table>
<!--<div slot="footer" class="dialog-footer" style="margin-top: 50px">-->
<!-- <el-button @click.native="hideForm">取消</el-button>-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- @click.native="formSubmit()"-->
<!-- >提交-->
<!-- </el-button-->
<!-- >-->
<!--</div>-->
</div>
</template>
@ -73,6 +131,7 @@ import {
createFreightCode,
updateWorkplaceFreight
} from '@/api/basic/workPlace/SysWorkplaceFreight'
import { getLayerCode, getLayerList, saveLayer } from '@/api/basic/workPlace/SysWorkplaceLayer'
export default {
props: {
@ -96,13 +155,26 @@ export default {
freightData: null,
workPlaces: [],
formRules: {
name: [
{ required: true, message: '请输入货架名称', trigger: 'blur' }
],
// name: [
// { required: true, message: '', trigger: 'blur' }
// ],
workPlaceIdFk: [
{ required: true, message: '请选择所属工位', trigger: 'blur' }
],
}
},
LayerQuery:{
page: 1,
limit: 10,
freightCode:""
},
layerList:[],
saveStatus: false, //
addStatus: false, //
selectedIndex: null,//
// {
// code:null,
// queueNum:null,
// }
}
},
methods: {
@ -161,12 +233,67 @@ export default {
},
hideForm(){
this.closeDialog()
}
},
//
addWorkplaceLayer(){
if(this.addStatus == true ){
this.$message.error('请先保存当摆货层在进行添加')
return
}
getLayerCode({freightCode : this.formData.code } ).then(res => {
if (res.code == 20000){
this.layerList.push({
code: res.data,
queueNum: null,
freightCode:this.formData.code,
workPlaceIdFk:this.formData.code.workPlaceIdFk,
remark:this.formData.remark
})
}else {
this.$message.error("系统繁忙")
}
})
this.addStatus = true
},
//
handleEdit(index, val){
if(this.saveStatus == true ){
this.$message.error('请先保存当前产品标识编辑')
return
}
this.selectedIndex = index
this.saveStatus = true
},
handleSave(row){
if (row.queueNum == null || row.queueNum ==0){
return this.$message.error("请输入出货槽数量")
}
saveLayer(row).then(res => {
if (res.code == 20000){
this.selectedIndex = null
this.saveStatus = false
this.closeDialog()
this.$message.success("新增成功!")
}
})
},
getLayers(){
this.LayerQuery.freightCode = this.formData.code
getLayerList(this.LayerQuery).then(res => {
if (res.code == 20000){
this.layerList = res.data.list || []
}else {
this.layerList = []
}
})
},
},
created() {
if (this.rowData != null){
this.formData = this.rowData
this.formData.workPlaceIdFk = String(this.rowData.workPlaceIdFk)
this.getLayers()
}else {
this.getCode()
}
@ -177,5 +304,8 @@ export default {
</script>
<style scoped>
.dialog-footer {
display: flex;
justify-content: center;
}
</style>

@ -0,0 +1,181 @@
<template>
<div>
<el-form :model="formData" style="width: 100%;" ref="dataForm" :rules="formRules"
label-width="auto"
>
<el-row :gutter="24">
<el-col :span="12" class="el-col">
<el-form-item label="货架编码:" prop="code" class="query-form-item">
<el-input
v-model="formData.code" style="width: 80%"
auto-complete="off"
disabled
></el-input>
</el-form-item>
</el-col>
<el-col :span="12" class="el-col">
<el-form-item label="货架名称:" class="query-form-item" prop="name">
<el-input
v-model="formData.name" style="width: 80%"
auto-complete="off"
placeholder="请输入货架名称"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="12" class="el-col">
<el-form-item label="所属工位:" class="query-form-item" prop="workPlaceIdFk">
<el-select
v-model="formData.workPlaceIdFk"
filterable
remote
style="width: 80%"
placeholder="请输入选择所属工位"
>
<el-option
v-for="item in workPlaces"
:key="item.code"
:label="item.label"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="12" class="el-col">
<el-form-item label="备注:" prop="remake" class="query-form-item">
<el-input
v-model="formData.remark" style="width: 80%"
auto-complete="off"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click.native="hideForm">取消</el-button>
<el-button
type="primary"
@click.native="formSubmit()"
>提交
</el-button
>
</div>
</div>
</template>
<script>
import { filterWorkOptimize } from '@/api/basic/workPlace/sysWorkplaceManage'
import {
addWorkplaceFreight,
createFreightCode,
updateWorkplaceFreight
} from '@/api/basic/workPlace/SysWorkplaceFreight'
export default {
props: {
closeDialog: {
type: Function,
required: true
},
rowData: {
type: Object,
required: true
}
},
data() {
return {
formData: {
code: "",
name: "",
remark: "",
workPlaceIdFk: "",
},
freightData: null,
workPlaces: [],
formRules: {
name: [
{ required: true, message: '请输入货架名称', trigger: 'blur' }
],
workPlaceIdFk: [
{ required: true, message: '请选择所属工位', trigger: 'blur' }
],
}
}
},
methods: {
findWorkPlace(val) {
let query = {
// chargeUser: _this.$store.getters.userId,
userIdFlag: true,
key: val,
page: 1,
limit: 10,
workPlaceClass:2
}
filterWorkOptimize(query)
.then((response) => {
this.workPlaces = response.data || [];
})
.catch(() => {
this.options.getWorkPlaceList = [];
});
},
getCode(){
createFreightCode().then(res => {
if (res.code == 20000){
this.formData.code = res.data
}else {
this.formData = ""
}
})
},
formSubmit(){
// this.formData.workPlaceIdFk = this.workplaceId
this.$refs['dataForm'].validate((rules) => {
if (rules) {
if (this.rowData != null){
updateWorkplaceFreight(this.formData).then(res => {
if (res.code == 20000){
this.$message.success("更新成功")
this.closeDialog()
}else {
this.$message.error(res.message)
}
})
}else {
addWorkplaceFreight(this.formData).then(res => {
if (res.code == 20000){
this.$message.success("新增成功")
this.closeDialog()
}else {
this.$message.error(res.message)
}
})
}
}
})
},
hideForm(){
this.closeDialog()
}
},
created() {
if (this.rowData != null){
this.formData = this.rowData
this.formData.workPlaceIdFk = String(this.rowData.workPlaceIdFk)
}else {
this.getCode()
}
this.findWorkPlace("")
}
}
</script>
<style scoped>
</style>

@ -191,7 +191,7 @@
</pagination>
</el-card>
<el-tabs type="border-card" style="margin: 15px">
<el-tabs type="border-card" style="margin: 15px" @tab-click="handleTabClick">
<el-tab-pane>
<!-- {{ workplaceName }}--->
<span slot="label">采集工位</span>
@ -258,85 +258,92 @@
>
</pagination>
</el-tab-pane>
<el-tab-pane>
<!--<el-tab-pane>-->
<!-- &lt;!&ndash; {{ workplaceName }}-&ndash;&gt;-->
<!-- <span slot="label">货位</span>-->
<!-- <el-form :inline="true" :model="queueQuery" class="query-form" size="mini"-->
<!-- style="margin-bottom: 10px"-->
<!-- >-->
<!-- <el-form-item class="query-form-item" label="名称/编号:">-->
<!-- <el-input-->
<!-- v-model="queueQuery.key"-->
<!-- placeholder="请输入货位名称或货位编号"-->
<!-- clearable-->
<!-- ></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item>-->
<!-- <el-button-group>-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- icon="el-icon-refresh"-->
<!-- @click="onQueueList"-->
<!-- >重置-->
<!-- </el-button>-->
<!-- <el-button type="primary" @click="loadQueueList"-->
<!-- icon="el-icon-search"-->
<!-- >查询-->
<!-- </el-button-->
<!-- >-->
<!-- <el-button type="primary" @click="addPlaid"-->
<!-- icon="el-icon-plus"-->
<!-- >新增货位-->
<!-- </el-button-->
<!-- >-->
<!-- &lt;!&ndash;<el-button type="primary" @click="choosePlaid"&ndash;&gt;-->
<!-- &lt;!&ndash; icon="el-icon-plus"&ndash;&gt;-->
<!-- &lt;!&ndash;&gt;选入工位分格&ndash;&gt;-->
<!-- &lt;!&ndash;</el-button&ndash;&gt;-->
<!-- &lt;!&ndash;&gt;&ndash;&gt;-->
<!-- </el-button-group>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- <el-table :data="queueList" style="width: 100%;" :row-style="{height: '32px' }"-->
<!-- highlight-current-row-->
<!-- >-->
<!-- <el-table-column type="index" label="序号"></el-table-column>-->
<!-- &lt;!&ndash; <el-table-column label="业务类型编码 " prop="documentTypeCode" width="100"></el-table-column>&ndash;&gt;-->
<!-- <el-table-column label="货位名称" prop="name"></el-table-column>-->
<!-- <el-table-column label="货位编号 " prop="code"></el-table-column>-->
<!-- <el-table-column label="产品名称" prop="productName"></el-table-column>-->
<!-- <el-table-column label="产品规格" prop="productSpec"></el-table-column>-->
<!-- <el-table-column label="备注" prop="remark"></el-table-column>-->
<!-- <el-table-column label="操作" fixed="right" width="120">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- type="text"-->
<!-- size="small"-->
<!-- @click.native.stop="printQueue(scope.row)"-->
<!-- >打印-->
<!-- </el-button>-->
<!-- <el-button-->
<!-- type="text"-->
<!-- size="small"-->
<!-- @click.native.stop="updateQueue(scope.row)"-->
<!-- >编辑-->
<!-- </el-button>-->
<!-- <el-button-->
<!-- type="text"-->
<!-- size="small"-->
<!-- @click.native.stop="removeQueue(scope.row)"-->
<!-- >删除-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- <pagination-->
<!-- :total="collectTotal"-->
<!-- :limit.sync="cargowQuery.limit"-->
<!-- :page.sync="cargowQuery.page"-->
<!-- @pagination="getCargowBindCollectList()"-->
<!-- >-->
<!-- </pagination>-->
<!--</el-tab-pane>-->
<el-tab-pane label="货架" name="huojia">
<!-- {{ workplaceName }}--->
<span slot="label">货位</span>
<el-form :inline="true" :model="queueQuery" class="query-form" size="mini"
style="margin-bottom: 10px"
>
<el-form-item class="query-form-item" label="名称/编号:">
<el-input
v-model="queueQuery.key"
placeholder="请输入货位名称或货位编号"
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button
type="primary"
icon="el-icon-refresh"
@click="onQueueList"
>重置
</el-button>
<el-button type="primary" @click="loadQueueList"
icon="el-icon-search"
>查询
</el-button
>
<el-button type="primary" @click="addPlaid"
icon="el-icon-plus"
>新增货位
</el-button
>
<!--<el-button type="primary" @click="choosePlaid"-->
<!-- icon="el-icon-plus"-->
<!--&gt;选入工位分格-->
<!--</el-button-->
<!--&gt;-->
</el-button-group>
</el-form-item>
</el-form>
<el-table :data="queueList" style="width: 100%;" :row-style="{height: '32px' }"
highlight-current-row
>
<el-table-column type="index" label="序号"></el-table-column>
<!-- <el-table-column label="业务类型编码 " prop="documentTypeCode" width="100"></el-table-column>-->
<el-table-column label="货位名称" prop="name"></el-table-column>
<el-table-column label="货位编号 " prop="code"></el-table-column>
<el-table-column label="产品名称" prop="productName"></el-table-column>
<el-table-column label="产品规格" prop="productSpec"></el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column>
<el-table-column label="操作" fixed="right" width="120">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="printQueue(scope.row)"
>打印
</el-button>
<el-button
type="text"
size="small"
@click.native.stop="updateQueue(scope.row)"
>编辑
</el-button>
<el-button
type="text"
size="small"
@click.native.stop="removeQueue(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:total="collectTotal"
:limit.sync="cargowQuery.limit"
:page.sync="cargowQuery.page"
@pagination="getCargowBindCollectList()"
>
</pagination>
<freightManage
ref="freightManage"
:workplaceId="workplaceId"
></freightManage>
</el-tab-pane>
</el-tabs>
</el-col>
@ -600,10 +607,12 @@ import { addTree, deleteTree, getTree, updateTree } from '@/api/basic/collectPoi
import { delCollect, getBindCollectList } from '@/api/basic/collectPoint/cargowWorkplaceManage'
import addCollectWorkplace from './addCollectWorkplace'
import addPlaidDialog from './addPlaidDialog'
import freightManage from "./freightManage"
import { deleteQueue, getQueueList, printQueueLabel } from '@/api/basic/workPlace/SysWorkplaceQueue'
import { getWorkplaceFreightList } from '@/api/basic/workPlace/SysWorkplaceFreight'
export default {
components: { addCollectWorkplace, addPlaidDialog },
components: { addCollectWorkplace, addPlaidDialog,freightManage },
data() {
return {
Dictionary: false,
@ -624,6 +633,16 @@ export default {
workPlaceClass: 2,
deptCode: this.$store.getters.locDeptCode
},
freightQuery: {
page: 1,
limit: 4,
workPlaceIdFk: "",
key: "",
// code: null,
// workplaceStatus: 1,
// workPlaceClass: 2,
// deptCode: this.$store.getters.locDeptCode
},
DeptList: [],
list: [],
collectList: [],
@ -897,7 +916,20 @@ export default {
// this.getUserBindWork(this.cargowQuery)
// this.getWorkBindBusTypes()
this.getCargowBindCollectList()
this.getQueueList()
//
this.$refs.freightManage.getAllList(row.workplaceId)
},
getFreightList(){
getWorkplaceFreightList(this.freightQuery).then(res => {
if (res.code == 20000){
this.freightList = res.data.list || []
this.total = res.data.total || 0
}else {
this.total = 0
this.freightList = []
}
})
},
getCargowBindCollectList() {
this.cargowQuery.workPlaceCode = this.rowData.workplaceId
@ -1287,6 +1319,13 @@ export default {
}).catch((error) => {
this.$message.error('工位未绑定货位')
})
},
handleTabClick(tab){
if (tab.name === 'huojia') {
if (this.$refs.freightManage) {
this.$refs.freightManage.getAllList();
}
}
}
},
created() {

Loading…
Cancel
Save