From 4889e7ce264b97c08b4c85bdf951ba338abccb81 Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Wed, 6 Nov 2024 21:28:17 +0800 Subject: [PATCH] =?UTF-8?q?11/6=20=E8=B4=A7=E6=9E=B61.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/basic/workPlace/SysWorkplaceLayer.js | 27 +++ src/api/basic/workPlace/SysWorkplaceQueue.js | 4 +- .../workplace/addWorkplaceFreightDialog.vue | 182 +++++++++++++--- .../addWorkplaceFreightDialogCopy.vue | 181 ++++++++++++++++ .../basic/workplace/cargowWorkplaceManage.vue | 201 +++++++++++------- 5 files changed, 486 insertions(+), 109 deletions(-) create mode 100644 src/api/basic/workPlace/SysWorkplaceLayer.js create mode 100644 src/views/basic/workplace/addWorkplaceFreightDialogCopy.vue diff --git a/src/api/basic/workPlace/SysWorkplaceLayer.js b/src/api/basic/workPlace/SysWorkplaceLayer.js new file mode 100644 index 00000000..aae01aa6 --- /dev/null +++ b/src/api/basic/workPlace/SysWorkplaceLayer.js @@ -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 + }); +} diff --git a/src/api/basic/workPlace/SysWorkplaceQueue.js b/src/api/basic/workPlace/SysWorkplaceQueue.js index 176b82dd..e28e8686 100644 --- a/src/api/basic/workPlace/SysWorkplaceQueue.js +++ b/src/api/basic/workPlace/SysWorkplaceQueue.js @@ -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 }); diff --git a/src/views/basic/workplace/addWorkplaceFreightDialog.vue b/src/views/basic/workplace/addWorkplaceFreightDialog.vue index f880bd7a..6dfd2f72 100644 --- a/src/views/basic/workplace/addWorkplaceFreightDialog.vue +++ b/src/views/basic/workplace/addWorkplaceFreightDialog.vue @@ -14,9 +14,9 @@ - + @@ -43,26 +43,84 @@ - - - - - - - + + + + + + + + + + + - @@ -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 { diff --git a/src/views/basic/workplace/addWorkplaceFreightDialogCopy.vue b/src/views/basic/workplace/addWorkplaceFreightDialogCopy.vue new file mode 100644 index 00000000..f880bd7a --- /dev/null +++ b/src/views/basic/workplace/addWorkplaceFreightDialogCopy.vue @@ -0,0 +1,181 @@ + + + + + diff --git a/src/views/basic/workplace/cargowWorkplaceManage.vue b/src/views/basic/workplace/cargowWorkplaceManage.vue index 7c8b3c8d..97b5f89a 100644 --- a/src/views/basic/workplace/cargowWorkplaceManage.vue +++ b/src/views/basic/workplace/cargowWorkplaceManage.vue @@ -191,7 +191,7 @@ - + 采集工位 @@ -258,85 +258,92 @@ > - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - 货位 - - - - - - - 重置 - - 查询 - - 新增货位 - - - - - - - - - - - - - - - - - - - - - - - + @@ -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() {