From f3abf1480ce3f3a42eb0af0bfb8030b9221ad7fb Mon Sep 17 00:00:00 2001 From: "[li_she]" <[li.she@xujiesoft.com]> Date: Tue, 7 Mar 2023 15:10:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=8D=E5=88=B6=E5=B7=A5=E8=89=BA=E8=B7=AF?= =?UTF-8?q?=E7=BA=BF=E5=8A=9F=E8=83=BD=20=202023=E5=B9=B43=E6=9C=887?= =?UTF-8?q?=E6=97=A5=20sxm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/base/site.js | 3 + .../modules/base/maintainProductRouting.vue | 72 +++++++++++++++++-- 2 files changed, 69 insertions(+), 6 deletions(-) diff --git a/src/api/base/site.js b/src/api/base/site.js index 1b5d870..d585b86 100644 --- a/src/api/base/site.js +++ b/src/api/base/site.js @@ -162,3 +162,6 @@ export const deleteSORoutingResource= data => createAPI(`/base/deleteSORoutingRe export const getSORoutingRevNo= data => createAPI(`/base/getSORoutingRevNo`,'post',data) // export const updateRevNoData= data => createAPI(`/base/updateRevNoData`,'post',data) + +// 获取当前物料最大工序 +export const getPartNoRouteInMaxItemNo= data => createAPI(`/base/getPartNoRouteInMaxItemNo`,'post',data) diff --git a/src/views/modules/base/maintainProductRouting.vue b/src/views/modules/base/maintainProductRouting.vue index f9bb225..6dcbf9b 100644 --- a/src/views/modules/base/maintainProductRouting.vue +++ b/src/views/modules/base/maintainProductRouting.vue @@ -72,6 +72,9 @@ {{ buttons.update }} + {{ '复制' }} + {{ buttons.delete }} @@ -155,7 +158,7 @@ {{ buttons.search }} - + {{ buttons.save }} - {{buttons.close}} + {{ buttons.close }} @@ -593,7 +596,8 @@ import { saveCopyRouting, setDefault, saveRoutingHeaderData, - deleteRoutingHeaderData + deleteRoutingHeaderData, + getPartNoRouteInMaxItemNo } from "@/api/base/site.js" import Chooselist from '@/views/modules/common/Chooselist' import { @@ -1635,6 +1639,62 @@ export default { }) }, methods: { + // 复制 + copyItemRouting() { + if (!this.currentRow) { + this.$message.warning('请选择需要复制的工序!') + return + } + // 获取 + getPartNoRouteInMaxItemNo(this.currentRow).then(({data}) => { + if (data.code == 0) { + let maxItem = JSON.parse(JSON.stringify(this.currentRow)) + maxItem.itemNo = Number(data.data) + 10 + let dto = { + itemNo: Number(data.data) + 10, + add: 0, + crewsize: maxItem.crewsize, + efficiency: maxItem.efficiency, + factorUnit: maxItem.factorUnit, + jjgzUnitFactor: maxItem.jjgzUnitFactor, + jjgzUnitPrice: maxItem.jjgzUnitPrice, + machRunFactor: maxItem.machRunFactor, + machSetupTime: maxItem.machSetupTime, + operationDesc: maxItem.operationDesc, + partNo: maxItem.partNo, + remark: maxItem.remark, + revNo: maxItem.revNo, + site: maxItem.site, + user:this.$store.state.user.name, + workCenterNo: maxItem.workCenterNo, + } + // 保存信息 + saveRoutingDetailData(dto).then(({data}) => { + if (data && data.code == 200) { + this.detailmodelFlag = false + let data1 = { + site: this.mainData.site, + partNo: this.mainData.partNo, + revNo: this.mainData.revNo, + } + searchRoutingDetailData(data1).then(({data}) => { + if (data.total == 0) { + this.dataList2 = [] + } else { + this.dataList2 = data.rows; + } + }) + + this.$message.success(this.labels.doYes) + } else { + this.$alert(data.msg, this.labels.error, { + confirmButtonText: this.labels.true + }) + } + }) + } + }) + }, editRoutingHeaderModel(row) { this.routingHeaderData = { partNo: row.partNo, @@ -1862,11 +1922,11 @@ export default { return false; } - if (this.detailData.machRunFactor<=0) { + if (this.detailData.machRunFactor <= 0) { this.$message.warning('单位产出量不能小于0!') return } - if (this.detailData.crewsize<1) { + if (this.detailData.crewsize < 1) { this.$message.warning('操作工人数不能少于1!') return } @@ -1999,7 +2059,7 @@ export default { }, getSearchModal() { this.searchPartNo = ''; - // this.searchRoutingWithPartNo(); + // this.searchRoutingWithPartNo(); this.modelFlag = true; }, editRoutingDetail() {