Merge pull request '组批次规则维护复制功能' (#10) from develop-组批次规则拓扑图 into master

Reviewed-on: http://git.xdadan.loc/tanex/emis-frontend/pulls/10
This commit is contained in:
wuteng 2025-07-04 10:43:01 +08:00
commit d8b21c55d0
2 changed files with 44 additions and 7 deletions

View File

@ -93,6 +93,9 @@ export default {
props:{
id:{
type:Number
},
titleType:{
type:String,
}
},
components: {
@ -145,7 +148,7 @@ export default {
this.loading = false;
});
}else{
this.reset();
this.reset();
}
},
// 取消按钮
@ -173,17 +176,34 @@ export default {
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
// if (this.form.id != null) {
if(this.titleType=="edit"){
updateEmisTransPlanRule(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.$emit("on-changed");
});
} else {
} else if(this.titleType=="add"){
addEmisTransPlanRule(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.$emit("on-changed");
this.$emit("on-changed");
});
}
} else if(this.titleType=="copy"){
let newform ={
endDate:this.form.endDate,
remark:this.form.remark,
lineCode:this.form.lineCode,
productType:this.form.productType,
startSiteCode:this.form.startSiteCode,
nextSiteCode:this.form.nextSiteCode,
manager:this.form.manager,
supplierCode:this.form.supplierCode,
startDate:this.form.startDate,
};
addEmisTransPlanRule(newform).then(response => {
this.$modal.msgSuccess("复制成功");
this.$emit("on-changed");
});
}
}
});
},

View File

@ -133,6 +133,14 @@
v-hasPermi="['emis:emisTransPlanRule:edit']"
>按线路重算</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
@click="handleCopy"
>复制规则</el-button>
</el-col>
</el-row>
</div>
@ -157,7 +165,7 @@
</XdTable>
<el-dialog :title="titleForm" :visible.sync="openForm" width="50%" :destroy-on-close="true" v-dialogDrag append-to-body>
<emisTransPlanRuleForm :id="currentId" @on-changed="handleFormChanged" @on-cancel="cancelForm"></EmisTransPlanRuleForm>
<emisTransPlanRuleForm :id="currentId" @on-changed="handleFormChanged" @on-cancel="cancelForm" :titleType="titleType"></EmisTransPlanRuleForm>
</el-dialog>
<el-dialog :title="titleBatchForm" :visible.sync="openBatchUpdateForm" width="50%" :destroy-on-close="true" :close-on-click-modal="false" v-dialogDrag append-to-body>
@ -229,7 +237,7 @@ export default {
currentId:null,
openForm: false,
titleForm: "",
titleType:'',
// 弹出展示层
id:null,
titleView:"",
@ -298,6 +306,7 @@ export default {
this.currentId=null;
this.openForm= true;
this.titleForm = "新增规则";
this.titleType="add"
},
handleShowMoreInput(){
this.moreInputVisible = !this.moreInputVisible;
@ -320,6 +329,14 @@ export default {
this.currentId= row.id||this.ids[0];
this.openForm = true;
this.titleForm = "修改规则";
this.titleType="edit";
},
/**复制按钮操作 */
handleCopy(row){
this.currentId= row.id||this.ids[0];
this.openForm = true;
this.titleForm = "复制规则";
this.titleType="copy";
},
handleView(row) {
this.id=row.id;