| | |
| | | <!-- 树节点添加对话框--> |
| | | <el-dialog :title="this.TreeFlag ? '添加分类' :'添加主题库'" :before-close="TreeEscHandler" :visible.sync="TreeAddFormVisible" v-loading="AddLoading" append-to-body |
| | | style="width: 1700px;margin: auto"> |
| | | <el-form :model="TreeAddform" :rules="rules"> |
| | | <el-form ref="myForm" :model="TreeAddform" :rules="rules"> |
| | | <el-form-item :label="this.TreeFlag ? '分类编号:' :'主题库编号:'" label-width="150px" style="display: inline-block" prop="id"> |
| | | <el-input v-model="TreeAddform.id" autocomplete="off" style="width: 170px"></el-input> |
| | | </el-form-item> |
| | |
| | | //树节点取消事件 |
| | | TreeEscHandler(){ |
| | | this.TreeAddform={}; |
| | | this.TreeAddFormVisible=false |
| | | this.TreeAddFormVisible=false; |
| | | // 关闭弹窗清空校验 |
| | | this.$refs.myForm.clearValidate(); |
| | | }, |
| | | //树节点添加事件 |
| | | TreeAddHandler() { |
| | | const data = this.TreeAddform; |
| | | // data.btmtypename= this.TreeList.btmtypename |
| | | this.$set(data, "parentCodeClassifyOid", this.nodeClickList.oid); |
| | | TreeSave(data) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "添加成功!", |
| | | if ((!this.TreeAddform.id || !this.TreeAddform.name) || (this.TreeFlagCode && !this.TreeAddform.btmTypeName)) { |
| | | this.$message.warning('请输入内容!'); |
| | | }else { |
| | | const data = this.TreeAddform; |
| | | // data.btmtypename= this.TreeList.btmtypename |
| | | this.$set(data, "parentCodeClassifyOid", this.nodeClickList.oid); |
| | | TreeSave(data) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "添加成功!", |
| | | }); |
| | | Object.keys(this.TreeAddform).forEach(key => { |
| | | this.TreeAddform[key] = ""; |
| | | }); |
| | | this.getAttr(); |
| | | this.TreeAddFormVisible = false; |
| | | //添加完成后右侧清空 |
| | | this.ProData=[]; |
| | | this.Formlist=[]; |
| | | }) |
| | | .catch((res) => { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: res, |
| | | }); |
| | | }); |
| | | Object.keys(this.TreeAddform).forEach(key => { |
| | | this.TreeAddform[key] = ""; |
| | | }); |
| | | this.getAttr(); |
| | | this.TreeAddFormVisible = false; |
| | | //添加完成后右侧清空 |
| | | this.ProData=[]; |
| | | this.Formlist=[]; |
| | | }) |
| | | .catch((res) => { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: res, |
| | | }); |
| | | }); |
| | | } |
| | | }, |
| | | //树节点删除按钮 |
| | | TreeDel() { |