| | |
| | | <div> |
| | | <div> |
| | | <div style="display: flex; flex-direction: column;"> |
| | | <div style="display: flex;"> |
| | | <el-button v-if="permissionList.TreeAddStatus" plain size="small" type="primary" @click="TreeAdd">添加 |
| | | <div style="display: flex;justify-content: space-around"> |
| | | <el-button v-if="permissionList.TreeAddStatus" plain size="mini" type="primary" @click="TreeAdd">添加 |
| | | </el-button> |
| | | <el-button v-if="permissionList.TreeEditStatus" plain size="small" type="primary" @click="TreeEdit">修改 |
| | | <el-button v-if="permissionList.TreeEditStatus" plain size="mini" type="primary" @click="TreeEdit">修改 |
| | | </el-button> |
| | | <el-button v-if="permissionList.TreeDelStatus" plain size="small" type="primary" @click="TreeDel">删除 |
| | | </el-button> |
| | | <el-button v-if="permissionList.flushedStatus" plain size="small" type="primary" @click="flushed">刷新 |
| | | <el-button v-if="permissionList.TreeDelStatus" plain size="mini" type="primary" @click="TreeDel">删除 |
| | | </el-button> |
| | | </div> |
| | | <div style="display: flex; margin-top: 10px"> |
| | | <el-button v-if="permissionList.EnableStatus" plain size="small" type="primary" @click="Enable">启用 |
| | | <div style="display: flex; margin-top: 10px;justify-content: space-around"> |
| | | <el-button v-if="permissionList.flushedStatus" plain size="mini" type="primary" @click="flushed">刷新 |
| | | </el-button> |
| | | <el-button v-if="permissionList.DeactivateStatus" plain size="small" type="primary" @click="Deactivate"> |
| | | <el-button v-if="permissionList.EnableStatus" plain size="mini" type="primary" @click="Enable">启用 |
| | | </el-button> |
| | | <el-button v-if="permissionList.DeactivateStatus" plain size="mini" type="primary" @click="Deactivate"> |
| | | 停用 |
| | | </el-button> |
| | | <el-button v-if="permissionList.ImportExcelStatus" plain size="small" type="primary" |
| | | </div> |
| | | <div style="display: flex; margin-top: 10px;justify-content: space-around"> |
| | | <el-button v-if="permissionList.ImportExcelStatus" plain size="mini" type="primary" |
| | | @click.native="ImportExcel">导入 |
| | | </el-button> |
| | | <el-button v-if="permissionList.ExportExcelStatus" plain size="small" type="primary" |
| | | <el-button v-if="permissionList.ExportExcelStatus" plain size="mini" type="primary" |
| | | @click="ExportExcel">导出 |
| | | </el-button> |
| | | <el-button v-if="permissionList.ExportExcelStatus" plain size="mini" type="primary" |
| | | @click="testHandler">测试 |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | |
| | | upVersion, |
| | | stopLose, |
| | | startRelease, |
| | | exportClassify |
| | | exportClassify, |
| | | flowingDependencyGen |
| | | } from "@/api/template/templateAttr"; |
| | | import {defaultReferDataGrid, referDataGrid} from '@/api/MasterData/master' |
| | | import func from "@/util/func"; |
| | |
| | | created() { |
| | | }, |
| | | methods: { |
| | | testHandler(){ |
| | | if(this.nodeClickList.length <=0 ){ |
| | | this.$message.warning('请至少选择一条数据!') |
| | | return; |
| | | } |
| | | console.log(this.nodeClickList.oid) |
| | | flowingDependencyGen(this.nodeClickList.oid).then(res => { |
| | | this.$message.success('操作成功') |
| | | }).catch(res => { |
| | | this.$message.error(res) |
| | | }) |
| | | }, |
| | | // switch |
| | | switchChange() { |
| | | this.TreeAddform.isParticipateCheck = this.TreeAddform.codeKeyAttrValue === true ? 1 : 0; |
| | |
| | | }, |
| | | //分类树数据处理 |
| | | getAttr() { |
| | | this.loading = true; |
| | | return new Promise((resolve, reject) => { |
| | | getAtrrList() |
| | | .then(res => { |
| | |
| | | } |
| | | return item; |
| | | }); |
| | | this.loading = false; |
| | | resolve(); // 完成请求,调用resolve方法 |
| | | }) |
| | | .catch(error => { |
| | |
| | | this.$refs.myForm.clearValidate(); |
| | | }, |
| | | //树节点添加事件 |
| | | TreeAddHandler() { |
| | | async TreeAddHandler() { |
| | | if ((!this.TreeAddform.id || !this.TreeAddform.name) || (this.TreeFlagCode && !this.TreeAddform.btmTypeName)) { |
| | | this.$message.warning('请输入内容!'); |
| | | } else { |
| | | return; |
| | | } |
| | | try { |
| | | const data = this.TreeAddform; |
| | | 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.TreeAddform.codeKeyAttrValue = true; |
| | | this.TreeAddform.isParticipateCheck = 1; |
| | | }); |
| | | this.getAttr(); |
| | | this.TreeAddFormVisible = false; |
| | | //添加完成后右侧清空 |
| | | this.ProData = []; |
| | | this.Formlist = []; |
| | | }) |
| | | .catch((res) => { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: res, |
| | | }); |
| | | }); |
| | | await TreeSave(data) |
| | | this.$message.success("添加成功!"); |
| | | Object.keys(this.TreeAddform).forEach(key => { |
| | | this.TreeAddform[key] = ""; |
| | | }); |
| | | this.TreeAddform.codeKeyAttrValue = true; |
| | | this.TreeAddform.isParticipateCheck = 1; |
| | | this.getAttr(); |
| | | this.TreeAddFormVisible = false; |
| | | //添加完成后右侧清空 |
| | | this.ProData = []; |
| | | this.Formlist = []; |
| | | } catch (res) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: res, |
| | | }); |
| | | } |
| | | }, |
| | | //树节点删除按钮 |
| | |
| | | } |
| | | }, |
| | | //树刷新 |
| | | flushed() { |
| | | this.loading = true; |
| | | this.getAttr() |
| | | .then(() => { |
| | | this.loading = false; |
| | | this.$refs.tree.setCurrentKey(null); |
| | | this.nodeClickList = {} |
| | | this.TreeList = [] |
| | | this.TreeFlagCode = true; |
| | | }) |
| | | .catch(error => { |
| | | this.loading = false; |
| | | console.error(error); |
| | | }); |
| | | async flushed() { |
| | | await this.getAttr() |
| | | this.$refs.tree.setCurrentKey(null); |
| | | this.nodeClickList = {} |
| | | this.TreeList = [] |
| | | this.TreeFlagCode = true; |
| | | }, |
| | | //启用和停用都先判断状态 |
| | | //启用 |
| | |
| | | type: 'warning' |
| | | }); |
| | | if (confirmResult) { |
| | | await TreeEnable(this.nodeClickList); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '启用成功!' |
| | | }); |
| | | await TreeEnable(this.nodeClickList).then(res => { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '启用成功!' |
| | | }); |
| | | }) |
| | | await this.getAttr(); |
| | | |
| | | } else { |
| | | this.$message({ |
| | | type: 'info', |
| | |
| | | type: 'warning' |
| | | }); |
| | | if (confirmResult) { |
| | | await TreeDeactivate(this.nodeClickList); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '停用成功!' |
| | | }); |
| | | await TreeDeactivate(this.nodeClickList).then(res => { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '停用成功!' |
| | | }); |
| | | }) |
| | | this.nodeClickList['flag'] = true; |
| | | await this.getAttr(); |
| | | } else { |