From 53bf643f69301af3286a6a4b0e793c9b31169e31 Mon Sep 17 00:00:00 2001 From: mengjiao <3338049200@qq,com> Date: Wed, 17 Apr 2024 09:34:04 +0800 Subject: [PATCH] =?UTF-8?q?wms=E6=88=90=E5=93=81=E7=9B=98=E7=82=B9?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BF=AE=E6=94=B92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/systemFinished/systemFinished.js | 9 + src/api/wms/detailed.js | 9 +- src/views/wms/systemFinished/index.vue | 270 ++++++++++++++---- .../wms/systemFinished/selectWorkOrder.vue | 76 ++--- .../wms/systemFinished/selectWorkOrderTwo.vue | 149 ++++++++++ 5 files changed, 420 insertions(+), 93 deletions(-) create mode 100644 src/views/wms/systemFinished/selectWorkOrderTwo.vue diff --git a/src/api/systemFinished/systemFinished.js b/src/api/systemFinished/systemFinished.js index 712caf1..4fc8420 100644 --- a/src/api/systemFinished/systemFinished.js +++ b/src/api/systemFinished/systemFinished.js @@ -9,6 +9,15 @@ export function listSystemFinished(query) { }); } +// 新增成品盘点单 +export function addOdsProductEmbryoInventory(data) { + return request({ + url: '/wms/systemFinished/addOdsProductEmbryoInventory', + method: 'post', + params: data + }); +} + // 查询成品盘点单详细 export function getSystemFinished(ID) { return request({ diff --git a/src/api/wms/detailed.js b/src/api/wms/detailed.js index e42ad4b..bfb9f3f 100644 --- a/src/api/wms/detailed.js +++ b/src/api/wms/detailed.js @@ -8,7 +8,14 @@ export function listDetailed(query) { params: query }); } - +// 查询成品库存明细列表 +export function listDetailedunt(query) { + return request({ + url: '/wms/detailed/listunt', + method: 'get', + params: query + }); +} // 查询成品库存明细详细 export function getDetailed(storageId) { return request({ diff --git a/src/views/wms/systemFinished/index.vue b/src/views/wms/systemFinished/index.vue index 5eb9381..7b1b6d6 100644 --- a/src/views/wms/systemFinished/index.vue +++ b/src/views/wms/systemFinished/index.vue @@ -21,6 +21,8 @@ @keyup.enter.native="handleQuery" /> + + - + 关闭 @@ -145,11 +147,11 @@ - + - + @@ -189,7 +191,7 @@ size="mini" type="text" icon="el-icon-delete" - @click="handleDelete(scope.row)" + @click="handleDeleteRW(scope.row)" v-hasPermi="['systemFinished:systemFinished:remove']" >删除 @@ -209,44 +211,86 @@ - + - + - + + + + + + + - + + + - + - + + + - - - + + + + + - + - + + + + - - + - + + + + + + - + + + + - + + + + + - + + @@ -256,29 +300,28 @@ - 清空 + 清空 仓库/位置创建 - 物资创建 + 物资创建 + - + - - - + + + - - + - - + + + + + + @@ -300,19 +351,24 @@ import { listSystemFinished, getSystemFinished, + addOdsProductEmbryoInventory, delSystemFinished, addSystemFinished, updateSystemFinished } from "@/api/systemFinished/systemFinished"; import ItemSelectWorkOrderk from "./selectWorkOrder.vue"; + import ItemSelectWorkOrderkTwo from "./selectWorkOrderTwo.vue"; + import {getBoardFactory} from "../../../api/kanban/Packagingline"; + import {getlistCK} from "../../../api/wms/outorder"; export default { name: "SystemFinished", - components: { ItemSelectWorkOrderk}, + components: { ItemSelectWorkOrderk,ItemSelectWorkOrderkTwo}, data() { return { // 遮罩层 loading: true, - + // + selectedItemsList: [], // showFlags:false, // @@ -330,7 +386,9 @@ // 成品盘点单表格数据 systemFinishedList: [], // - + factoryOptions:[], + Optionlistck:[], + locCodelistck:[], // 弹出层标题 title: "", // 是否显示弹出层 @@ -430,6 +488,7 @@ // 取消按钮 cancel() { this.open = false; + this.addoutorderList = []; // 清空表格数据 this.reset(); }, // 表单重置 @@ -479,7 +538,50 @@ this.resetForm("queryForm"); this.handleQuery(); }, - // 多选框选中数据 + /** 提交按钮 */ + // submitForm() { + // this.$refs["form"].validate(valid => { + // console.log("-"+valid) + // if (valid) { + // console.log("---"+this.form) + // + // // 使用 JSON.stringify() 将对象转换为字符串再打印 + // console.log("--- Form Data:", JSON.stringify(this.form)); + // + // } + // }); + // console.log("---"+this.addoutorderList) + // this.addoutorderList.forEach(item => { + // console.log(item); + // }); + // + // addOdsProductEmbryoInventory().then(response => { + // + // }); + // + // }, + submitForm() { + this.$refs["form"].validate(valid => { + if (valid) { + // 创建一个新对象formData并将form属性赋值给它 + const formData = Object.assign({}, this.form); + + // 将addoutorderList数组赋值给formData对象 + formData.addoutorderList = this.addoutorderList; + + // 打印整合后的数据对象 + console.log("Merged Data:", formData); + const jsonData = JSON.stringify(formData); + // 调用接口并传递整合后的数据对象 + addOdsProductEmbryoInventory(jsonData).then(response => { + // 处理接口返回结果 + }).catch(error => { + // 处理接口请求错误 + }); + } + }); + }, + // 多选框选中数据 handleSelectionChange(selection) { this.ids = selection.map(item => item.ID) this.single = selection.length !== 1 @@ -490,7 +592,28 @@ this.reset(); this.open = true; this.title = "盘点新增"; + this.selectfactoryCodelist(); + this.form.siteCode = '1000'; + this.getselect(); }, + getselect() { + // config.headers['poolName'] = localStorage.getItem('USER_POOL_NAME_CURRENT'); + let factoryCode = localStorage.getItem('USER_POOL_NAME_CURRENT').substring(3) + let params = { factoryCode: factoryCode }; // 构造一个包含工厂代码的对象 + let paramsJSON = JSON.stringify(params); // 将对象转换为JSON字符串 + console.log(factoryCode) + getlistCK(paramsJSON).then(response => { + //this.Optionlistck = response.data + console.log(response) + if (response.data) { + this.Optionlistck = response.data.map(item => ({ + value: item.userDefined1, + label: item.userDefined2 + })); + } + // console.log(this.Optionlistck) + }); + }, /** 修改按钮操作 */ handleUpdate(row) { this.reset(); @@ -502,30 +625,69 @@ this.title = "修改成品盘点单"; }); }, - handleDeleteRW(row){ - let datas =this.addoutorderList - for(var i=0;i { + console.log(response) + if (response.data) { + _this.factoryOptions = response.data.map(item => ({ + value: item.parentName, + label: item.deptName + })); + } + }) + .catch((error) => { + console.error("Failed to fetch factory data: ", error); + }); }, + WarehouseLocationCreation(){ console.log("---sda") this.$refs.ItemSelectWorkOrderk.showFlags = true; console.log("---ssda") }, - onSelectWorkOrder(obj) { - this.form.orderNo = obj.workorderCode; - this.form.materialName = obj.materialName; - this.form.materialCode = obj.materialCode; - this.form.quality = obj.quality; - this.form.unit = obj.unit; - this.form.incomeTime = obj.incomeTime; - getBatchList(obj.workorderCode).then(response => { - this.batchList = response; - }); + WarehouseLocationCreationTWO(){ + console.log("---sda") + this.$refs.ItemSelectWorkOrderkTwo.showFlags = true; + console.log("---ssda") + }, + Warehempty(){ + this.addoutorderList = []; // 清空数据 + }, + onSelectWorkOrder(selectedData) { + console.log("----------;;"+selectedData.length) + // this.form.unit = selectedData.unit; + // this.form.productName = selectedData.productName; + // this.form.productCode = selectedData.productCode; + // this.form.amount = selectedData.amount; + // this.form.wlCode = selectedData.wlCode; + // this.form.sn = selectedData.sn; + // 将选择的数据添加到 addoutorderList 数组中 + // this.addoutorderList.push(selectedData); + this.addoutorderList.push(...selectedData); + //查询库存--精确到库位 + // getBatchList(obj.workorderCode).then(response => { + // this.batchList = response; + // }); }, MaterialCreation(){ diff --git a/src/views/wms/systemFinished/selectWorkOrder.vue b/src/views/wms/systemFinished/selectWorkOrder.vue index b85b7d4..0f6ab7c 100644 --- a/src/views/wms/systemFinished/selectWorkOrder.vue +++ b/src/views/wms/systemFinished/selectWorkOrder.vue @@ -1,5 +1,5 @@