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() {