产品类型管理复制功能

This commit is contained in:
wuteng 2025-10-22 16:39:19 +08:00
parent b2c8e0258b
commit 6fb53f6d7b
2 changed files with 37 additions and 6 deletions

View File

@ -111,7 +111,11 @@ export default {
props:{ props:{
id:{ id:{
type:Number type:Number
} },
isCopy:{
type:Boolean,
default:false
},
}, },
components: { CountryPicker,EmisSiteSimplePicker,TransLinePicker }, components: { CountryPicker,EmisSiteSimplePicker,TransLinePicker },
dicts: [ dicts: [
@ -318,12 +322,15 @@ export default {
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null && !this.isCopy) {
updateEmisTransProduct(this.form).then(response => { updateEmisTransProduct(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.$emit("on-changed"); this.$emit("on-changed");
}); });
} else { } else {
if(this.isCopy){
this.form.id = null;
}
addEmisTransProduct(this.form).then(response => { addEmisTransProduct(this.form).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.$emit("on-changed"); this.$emit("on-changed");

View File

@ -134,6 +134,16 @@
v-hasPermi="['emis:emisTransProduct:export']" v-hasPermi="['emis:emisTransProduct:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
size="mini"
:disabled="single"
@click="handleCopy"
v-hasPermi="['emis:emisTransProduct:copy']"
>复制</el-button>
</el-col>
</el-row> </el-row>
</div> </div>
@ -193,7 +203,7 @@
<el-dialog :title="titleForm" :visible.sync="openForm" width="55%" :destroy-on-close="true" append-to-body> <el-dialog :title="titleForm" :visible.sync="openForm" width="55%" :destroy-on-close="true" append-to-body>
<emisTransProductForm :id="currentId" @on-changed="handleFormChanged" @on-cancel="cancelForm"></EmisTransProductForm> <emisTransProductForm :id="currentId" :isCopy="isCopy" @on-changed="handleFormChanged" @on-cancel="cancelForm"></EmisTransProductForm>
</el-dialog> </el-dialog>
@ -266,6 +276,8 @@ export default {
daterangeCreateTime: [], daterangeCreateTime: [],
// 备注时间范围 // 备注时间范围
daterangeUpdateTime: [], daterangeUpdateTime: [],
current:null,
isCopy: false,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
@ -388,12 +400,16 @@ export default {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id)
this.single = selection.length!==1 this.single = selection.length!==1
this.multiple = !selection.length this.multiple = !selection.length
let [lastObj]=selection.slice(-1);
this.current=lastObj;
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd(row) { handleAdd(row) {
this.currentId= null ; this.currentId= null ;
this.openForm = true; this.openForm = true;
this.titleForm = "修改"; this.titleForm = "新增";
this.isCopy = false;
}, },
handleShowMoreInput(){ handleShowMoreInput(){
this.moreInputVisible = !this.moreInputVisible; this.moreInputVisible = !this.moreInputVisible;
@ -404,7 +420,7 @@ export default {
this.currentId= row.id ; this.currentId= row.id ;
this.openForm = true; this.openForm = true;
this.titleForm = "修改"; this.titleForm = "修改";
this.isCopy = false;
}, },
handleView(row) { handleView(row) {
this.id=row.id; this.id=row.id;
@ -488,6 +504,14 @@ export default {
dateTimeChange(value){ dateTimeChange(value){
this.dateTimeRange=value; this.dateTimeRange=value;
}, },
handleCopy() {
// this.resetRefreshId="vipquote-"+this.getUUID();
this.currentId = this.current.id ;
this.openForm = true;
this.isCopy = true;
this.titleForm = "复制【"+this.current.prodName+"】";
},
} }
}; };
</script> </script>