Commit 09dc16a5 authored by 康振飞's avatar 康振飞

工艺克隆

parent 9ee1a059
...@@ -212,33 +212,15 @@ export default { ...@@ -212,33 +212,15 @@ export default {
this.$refs.form.validate(v => { this.$refs.form.validate(v => {
if (v) { if (v) {
this.disabled = true; this.disabled = true;
if(this.title=='克隆'){
this.$Message.success("克隆");
this.getcloneData()
}else{
if (this.$refs.refFile.nameList.length > 0) { if (this.$refs.refFile.nameList.length > 0) {
this.entity.fileId = this.parms.eid; this.entity.fileId = this.parms.eid;
} else { } else {
this.entity.fileId = ""; this.entity.fileId = "";
} }
if(this.title=='克隆'){
var parmese = {
"headerId": this.eid,
"code": this.entity.code
}
debugger
Api.cloneheader(parmese).then(r => {
this.disabled = false;
if (r.success) {
this.$Message.success("克隆成功");
this.$emit("on-ok");
} else {
this.$Message.error("克隆失败");
}
})
.catch(err => {
this.disabled = false;
this.$Message.error("克隆失败");
console.warn(err);
});
// this.cloneData(parmese)
}else{
Api.create(this.entity).then(r => { Api.create(this.entity).then(r => {
this.disabled = false; this.disabled = false;
if (r.success) { if (r.success) {
...@@ -258,12 +240,29 @@ export default { ...@@ -258,12 +240,29 @@ export default {
}); });
}, },
// 克隆工艺 // 克隆工艺
cloneData(parmese){ getcloneData(){
let parmese = {
headerId: this.eid,
code: this.entity.code
};
console.warn(parmese) console.warn(parmese)
Api.cloneheader(parmese).then(r => { Api.getCloneHeader(parmese).then(r => {
// this.disabled = false; debugger
console.log(r) console.log(r)
}) this.disabled = false;
if (r.success) {
this.$Message.success("克隆成功");
this.$emit("on-ok");
} else {
this.$Message.error("克隆失败");
}
})
.catch(err => {
this.disabled = false;
this.$Message.error("克隆失败");
console.warn(err);
});
// this.disabled = false;
}, },
handleClose() { handleClose() {
this.$emit("on-close"); this.$emit("on-close");
......
...@@ -13,6 +13,9 @@ export default { ...@@ -13,6 +13,9 @@ export default {
update(params) { update(params) {
return Api.put(`${technologyUrl}routingheader/update`, params); return Api.put(`${technologyUrl}routingheader/update`, params);
}, },
getCloneHeader(params){
return Api.post(`${technologyUrl}routingheader/cloneheader`,params);
},
delete(id) { delete(id) {
return Api.delete(`${technologyUrl}routingheader/delete`, { return Api.delete(`${technologyUrl}routingheader/delete`, {
params: { params: {
......
...@@ -10,9 +10,6 @@ export default { ...@@ -10,9 +10,6 @@ export default {
create(params){ create(params){
return Api.post(`${technologyUrl}routingheader/create`,params); return Api.post(`${technologyUrl}routingheader/create`,params);
}, },
cloneheader(params){
return Api.post(`${technologyUrl}routingheader/cloneheader`,params);
},
update(params){ update(params){
return Api.post(`${technologyUrl}routingheader/update`,params); return Api.post(`${technologyUrl}routingheader/update`,params);
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment