diff --git a/src/api/base/site.js b/src/api/base/site.js
index 8b83a7e..ce5f6e7 100644
--- a/src/api/base/site.js
+++ b/src/api/base/site.js
@@ -137,3 +137,7 @@ export const changeOrderRouting= data => createAPI(`/base/changeOrderRouting`,'p
export const saveCopyRouting= data => createAPI(`/base/saveCopyRouting`,'post',data)
//保存默认
export const setDefault = data => createAPI(`/base/setDefault`,'post',data)
+//保存产品工艺路线
+export const saveRoutingHeaderData = data => createAPI(`/base/saveRoutingHeaderData`,'post',data)
+//删除产品工艺路线
+export const deleteRoutingHeaderData = data => createAPI(`/base/deleteRoutingHeaderData`,'post',data)
diff --git a/src/views/modules/base/maintainProductRouting.vue b/src/views/modules/base/maintainProductRouting.vue
index 27365ce..608086a 100644
--- a/src/views/modules/base/maintainProductRouting.vue
+++ b/src/views/modules/base/maintainProductRouting.vue
@@ -124,6 +124,7 @@
查询
+ 新增
+
+
+ 修改
+ 删除
+
+
- 加工中心编码:
+ 加工中心编码:
@@ -225,7 +236,7 @@
- 工具编号:
+ 工具编号:
@@ -400,7 +411,7 @@
- 工艺路线编码:
+ 工艺路线编码:
@@ -450,6 +461,67 @@
关闭
+
+
+
+ 工艺路线编码:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存
+ 关闭
+
+
@@ -475,6 +547,8 @@
changeOrderRouting,
saveCopyRouting,
setDefault,
+ saveRoutingHeaderData,
+ deleteRoutingHeaderData
}from "@/api/base/site.js"
import Chooselist from '@/views/modules/common/Chooselist'
export default {
@@ -484,6 +558,21 @@
},
data () {
return {
+ routingHeaderInputFlag:false,
+ routingHeaderModelFlag:false,
+ routingHeaderData:{
+ partNo:'',
+ site:'',
+ status:'',
+ revNo:'',
+ phaseInDate:'',
+ phaseOutDate:'',
+ routingType:'',
+ remark:'',
+ defaultflag:'',
+ repairFlag:'',
+ add:'',
+ },
selectList:[],
resourceList1:[],
resourceList2:[],
@@ -1329,7 +1418,8 @@
revNo:'',
add:'',
user:'',
- }
+ },
+ tagNo2:'',
}
},
mounted() {
@@ -1338,6 +1428,99 @@
})
},
methods: {
+ editRoutingHeaderModel(row){
+ this.routingHeaderData={
+ partNo:row.partNo,
+ site:row.site,
+ status:row.status,
+ revNo:row.revNo,
+ phaseInDate:row.phaseInDate,
+ phaseOutDate:row.phaseOutDate,
+ routingType:row.routingType,
+ remark:row.remark,
+ defaultflag:row.defaultflag,
+ repairFlag:row.repairFlag,
+ add:1,
+ };
+ this.routingHeaderInputFlag=true;
+ this.routingHeaderModelFlag=true;
+ },
+ addRoutingHeaderModel(){
+ this.routingHeaderData={
+ partNo:'',
+ site:this.$store.state.user.site,
+ status:'试验',
+ revNo:'',
+ phaseInDate:new Date(),
+ phaseOutDate:null,
+ routingType:'制造',
+ remark:'',
+ defaultflag:'Y',
+ repairFlag:'N',
+ add:0,
+ };
+ this.routingHeaderInputFlag=false;
+ this.routingHeaderModelFlag=true;
+ },
+ saveRoutingHeaderData(){
+ if(this.routingHeaderData.partNo==''||this.routingHeaderData.partNo==null){
+ this.$alert("请输入工艺路线号!",'错误',{
+ confirmButtonText:'确定'
+ })
+ return false;
+ }
+ if(this.routingHeaderData.revNo==''||this.routingHeaderData.revNo==null){
+ this.$alert("请输入版本号!",'错误',{
+ confirmButtonText:'确定'
+ })
+ return false;
+ }
+ if(this.routingHeaderData.phaseInDate==''||this.routingHeaderData.phaseInDate==null){
+ this.$alert("请选择启用日期!",'错误',{
+ confirmButtonText:'确定'
+ })
+ return false;
+ }
+ saveRoutingHeaderData(this.routingHeaderData).then(({data}) => {
+ if (data && data.code == 200) {
+ this.routingHeaderModelFlag = false
+ this.searchRoutingWithPartNo();
+ this.$message({
+ message: '操作成功',
+ type: 'success',
+ duration: 1500,
+ onClose: () => {
+ }
+ })
+ } else {
+ this.$alert(data.msg, '错误', {
+ confirmButtonText: '确定'
+ })
+ }
+ })
+ },
+ deleteRoutingHeaderData(row){
+ this.$confirm(`是否删除此工艺路线的所有数据?`, '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }).then(() => {
+ let inData = {
+ site: row.site,
+ partNo: row.partNo,
+ revNo: row.revNo,
+ }
+ deleteRoutingHeaderData(inData).then(({data}) => {
+ if (data && data.code == 200) {
+ this.searchRoutingWithPartNo();
+ } else {
+ this.$alert(data.msg, '错误', {
+ confirmButtonText: '确定'
+ })
+ }
+ })
+ })
+ },
getBaseData(val){
if (this.tagNo === 24){
this.detailData.workCenterNo = val.WorkCenterNo
@@ -1347,23 +1530,33 @@
this.getToolDesc();
}
if (this.tagNo === 5){
- this.copyRoutingData.partNo1 = val.PartNo
- this.getPartDescription();
+ if(this.tagNo2===1) {
+ this.copyRoutingData.partNo1 = val.PartNo
+ this.getPartDescription();
+ }else {
+ this.routingHeaderData.partNo= val.PartNo
+ }
}
},
// 获取基础数据列表
- getBaseList(val){
+ getBaseList(val,val2){
this.tagNo = val
+ this.tagNo2 = val2
this.$nextTick(() => {
let strVal = "";
if (val === 24){
strVal = this.detailData.workCenterNo
}
if (val === 70){
- strVal = this.toolData.toolID
+ strVal = this.toolData.toolID
+
}
if (val === 5){
- strVal = this.copyRoutingData.partNo1
+ if(val2===1) {
+ strVal = this.copyRoutingData.partNo1
+ }else {
+ strVal = this.routingHeaderData.partNo
+ }
}
this.$refs.baseList.init(val,strVal)
})