Merge pull request '产品类型管理复制功能' (#121) from master-dev into master
Reviewed-on: http://git.xdadan.loc/tanex/emis-frontend/pulls/121
This commit is contained in:
commit
b5412e1532
@ -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");
|
||||
|
||||
@ -134,6 +134,16 @@
|
||||
v-hasPermi="['emis:emisTransProduct:export']"
|
||||
>导出</el-button>
|
||||
</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>
|
||||
|
||||
</div>
|
||||
@ -193,7 +203,7 @@
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
@ -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+"】";
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user