diff --git a/src/views/emis/emisTransProduct/emisTransProductForm.vue b/src/views/emis/emisTransProduct/emisTransProductForm.vue index 524b345b..0e3cc28f 100644 --- a/src/views/emis/emisTransProduct/emisTransProductForm.vue +++ b/src/views/emis/emisTransProduct/emisTransProductForm.vue @@ -111,7 +111,11 @@ export default { props:{ id:{ type:Number - } + }, + isCopy:{ + type:Boolean, + default:false + }, }, components: { CountryPicker,EmisSiteSimplePicker,TransLinePicker }, dicts: [ @@ -318,12 +322,15 @@ export default { submitForm() { this.$refs["form"].validate(valid => { if (valid) { - if (this.form.id != null) { + if (this.form.id != null && !this.isCopy) { updateEmisTransProduct(this.form).then(response => { this.$modal.msgSuccess("修改成功"); this.$emit("on-changed"); }); } else { + if(this.isCopy){ + this.form.id = null; + } addEmisTransProduct(this.form).then(response => { this.$modal.msgSuccess("新增成功"); this.$emit("on-changed"); diff --git a/src/views/emis/emisTransProduct/index.vue b/src/views/emis/emisTransProduct/index.vue index 9e565a44..b965d60b 100644 --- a/src/views/emis/emisTransProduct/index.vue +++ b/src/views/emis/emisTransProduct/index.vue @@ -134,6 +134,16 @@ v-hasPermi="['emis:emisTransProduct:export']" >导出 + + 复制 + @@ -193,7 +203,7 @@ - + @@ -266,6 +276,8 @@ export default { daterangeCreateTime: [], // 备注时间范围 daterangeUpdateTime: [], + current:null, + isCopy: false, // 查询参数 queryParams: { pageNum: 1, @@ -388,12 +400,16 @@ export default { this.ids = selection.map(item => item.id) this.single = selection.length!==1 this.multiple = !selection.length + let [lastObj]=selection.slice(-1); + this.current=lastObj; + }, /** 新增按钮操作 */ handleAdd(row) { this.currentId= null ; - this.openForm = true; - this.titleForm = "修改"; + this.openForm = true; + this.titleForm = "新增"; + this.isCopy = false; }, handleShowMoreInput(){ this.moreInputVisible = !this.moreInputVisible; @@ -404,7 +420,7 @@ export default { this.currentId= row.id ; this.openForm = true; this.titleForm = "修改"; - + this.isCopy = false; }, handleView(row) { this.id=row.id; @@ -488,6 +504,14 @@ export default { dateTimeChange(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+"】"; + }, } };