| | |
| | | <div> |
| | | <div style="display: flex; flex-direction: column;"> |
| | | <div style="display: flex;"> |
| | | <el-button plain size="small" type="primary" @click="TreeAdd" v-if="permissionList.TreeAddStatus">æ·»å </el-button> |
| | | <el-button plain size="small" type="primary" @click="TreeEdit" v-if="permissionList.TreeEditStatus">ä¿®æ¹</el-button> |
| | | <el-button plain size="small" type="primary" @click="TreeDel" v-if="permissionList.TreeDelStatus">å é¤</el-button> |
| | | <el-button plain size="small" type="primary" @click="flushed" v-if="permissionList.flushedStatus">å·æ°</el-button> |
| | | <el-button v-if="permissionList.TreeAddStatus" plain size="small" type="primary" @click="TreeAdd">æ·»å |
| | | </el-button> |
| | | <el-button v-if="permissionList.TreeEditStatus" plain size="small" 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> |
| | | </div> |
| | | <div style="display: flex; margin-top: 10px"> |
| | | <el-button plain size="small" type="primary" @click="Enable" v-if="permissionList.EnableStatus">å¯ç¨</el-button> |
| | | <el-button plain size="small" type="primary" @click="Deactivate" v-if="permissionList.DeactivateStatus">åç¨</el-button> |
| | | <el-button plain size="small" type="primary" @click.native="ImportExcel" v-if="permissionList.ImportExcelStatus">导å
¥</el-button> |
| | | <el-button plain size="small" type="primary" @click="ExportExcel" v-if="permissionList.ExportExcelStatus">导åº</el-button> |
| | | <el-button v-if="permissionList.EnableStatus" plain size="small" type="primary" @click="Enable">å¯ç¨ |
| | | </el-button> |
| | | <el-button v-if="permissionList.DeactivateStatus" plain size="small" type="primary" @click="Deactivate"> |
| | | åç¨ |
| | | </el-button> |
| | | <el-button v-if="permissionList.ImportExcelStatus" plain size="small" type="primary" |
| | | @click.native="ImportExcel">导å
¥ |
| | | </el-button> |
| | | <el-button v-if="permissionList.ExportExcelStatus" plain size="small" type="primary" |
| | | @click="ExportExcel">å¯¼åº |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | <div style="display: flex;justify-content: space-around;margin-top: 5px;margin-bottom: 5px"> |
| | | </div> |
| | | </div> |
| | | <!-- 左侧æ --> |
| | | <!-- 左侧æ --> |
| | | <div style="height: calc(100vh - 230px);overflow: auto"> |
| | | <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="CloneTreedata" |
| | | :defaultExpandAll="false" |
| | |
| | | <el-form-item label="æ¯å¦åä¸å
³é®å±æ§æ ¡éªï¼" label-width="170px"> |
| | | <el-switch |
| | | v-model="TreeAddform.codeKeyAttrValue" |
| | | active-text="æ¯" |
| | | inactive-text="å¦" |
| | | active-color="#13ce66" |
| | | active-text="æ¯" |
| | | inactive-color="#ff4949" |
| | | inactive-text="å¦" |
| | | @change="switchChange"> |
| | | </el-switch> |
| | | </el-form-item> |
| | |
| | | </template> |
| | | |
| | | <template slot="menuLeft"> |
| | | <el-button plain size="small" type="primary" @click="FindeHanler" v-if="permissionList.FindStatus">æ¥è¯¢</el-button> |
| | | <el-button plain size="small" type="primary" @click="TemRefresh" v-if="permissionList.TemRefreshStatus">å·æ°</el-button> |
| | | <el-button plain size="small" type="primary" @click="CloneBtn" v-if="permissionList.CloneBtnStuatus">ä»å
¶å®æ¨¡æ¿å
é</el-button> |
| | | <el-button v-if="permissionList.FindStatus" plain size="small" type="primary" |
| | | @click="FindeHanler">æ¥è¯¢</el-button> |
| | | <el-button v-if="permissionList.TemRefreshStatus" plain size="small" type="primary" |
| | | @click="TemRefresh">å·æ°</el-button> |
| | | <el-button v-if="permissionList.CloneBtnStuatus" plain size="small" type="primary" @click="CloneBtn">ä»å
¶å®æ¨¡æ¿å
é</el-button> |
| | | <!-- æ¥è¯¢å¯¹è¯æ¡--> |
| | | <el-dialog :visible.sync="FindFormVisible" append-to-body title="é«çº§æ¥è¯¢"> |
| | | <div> |
| | |
| | | import {defaultReferDataGrid, referDataGrid} from '@/api/MasterData/master' |
| | | import func from "@/util/func"; |
| | | import {mapGetters} from "vuex"; |
| | | |
| | | export default { |
| | | name: "classifyTrees.vue", |
| | | data() { |
| | |
| | | Option: { |
| | | addBtn: false, |
| | | index: true, |
| | | columnBtn:false, |
| | | columnBtn: false, |
| | | border: true, |
| | | menu: false, |
| | | height: 380, |
| | |
| | | codeRuleOidName: "", |
| | | //åå¨çä¸å¡ç±»å |
| | | btmTypeName: "", |
| | | codeKeyAttrValue:true, |
| | | isParticipateCheck:1 |
| | | codeKeyAttrValue: true, |
| | | isParticipateCheck: 1 |
| | | }, |
| | | rules: { |
| | | id: [ |
| | |
| | | CloneSelect: [], |
| | | //å
鿍¡æ¿option |
| | | ClonecrudTreeOption: { |
| | | columnBtn:false, |
| | | columnBtn: false, |
| | | index: true, |
| | | border: true, |
| | | menu: false, |
| | |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList(){ |
| | | return{ |
| | | TreeAddStatus:this.vaildData(this.permission.classifyTree.tree_add,false), |
| | | TreeEditStatus:this.vaildData(this.permission.classifyTree.tree_edit,false), |
| | | TreeDelStatus:this.vaildData(this.permission.classifyTree.tree_delete,false), |
| | | flushedStatus:this.vaildData(this.permission.classifyTree.tree_break,false), |
| | | EnableStatus:this.vaildData(this.permission.classifyTree.tree_enable,false), |
| | | DeactivateStatus:this.vaildData(this.permission.classifyTree.tree_stop,false), |
| | | ImportExcelStatus:this.vaildData(this.permission.classifyTree.tree_import,false), |
| | | ExportExcelStatus:this.vaildData(this.permission.classifyTree.tree_export,false), |
| | | FindStatus:this.vaildData(this.permission.classifyTree.manage_search,false), |
| | | TemRefreshStatus:this.vaildData(this.permission.classifyTree.manage_break,false), |
| | | CloneBtnStuatus:this.vaildData(this.permission.classifyTree.manage_clone,false), |
| | | permissionList() { |
| | | return { |
| | | TreeAddStatus: this.vaildData(this.permission.classifyTree.tree_add, false), |
| | | TreeEditStatus: this.vaildData(this.permission.classifyTree.tree_edit, false), |
| | | TreeDelStatus: this.vaildData(this.permission.classifyTree.tree_delete, false), |
| | | flushedStatus: this.vaildData(this.permission.classifyTree.tree_break, false), |
| | | EnableStatus: this.vaildData(this.permission.classifyTree.tree_enable, false), |
| | | DeactivateStatus: this.vaildData(this.permission.classifyTree.tree_stop, false), |
| | | ImportExcelStatus: this.vaildData(this.permission.classifyTree.tree_import, false), |
| | | ExportExcelStatus: this.vaildData(this.permission.classifyTree.tree_export, false), |
| | | FindStatus: this.vaildData(this.permission.classifyTree.manage_search, false), |
| | | TemRefreshStatus: this.vaildData(this.permission.classifyTree.manage_break, false), |
| | | CloneBtnStuatus: this.vaildData(this.permission.classifyTree.manage_clone, false), |
| | | } |
| | | }, |
| | | crudTreeOption() { |
| | | return { |
| | | index: true, |
| | | border: true, |
| | | columnBtn:false, |
| | | columnBtn: false, |
| | | height: 180, |
| | | addBtn: this.Formlist.length <= 0 && this.nodeClickList != "", |
| | | editBtn: false, |
| | |
| | | }, |
| | | methods: { |
| | | // switch |
| | | switchChange(){ |
| | | switchChange() { |
| | | this.TreeAddform.isParticipateCheck = this.TreeAddform.codeKeyAttrValue === true ? 1 : 0; |
| | | // console.log(this.TreeAddform.isParticipateCheck) |
| | | }, |
| | |
| | | this.$set(this.TreeAddform, 'codeRuleOidName', this.masterName) |
| | | this.$set(this.TreeAddform, 'codeRuleOid', this.masterOid) |
| | | this.$emit('MasterHandler', this.loneTreeNewForm) |
| | | this.masterRow=null; |
| | | this.masterRow = null; |
| | | } |
| | | }, |
| | | //ç¼ç æ¥å£ |
| | |
| | | referType: 'coderule', |
| | | isMuti: 'false', |
| | | 'conditionMap["lcstatus"]': 'Released', |
| | | 'limit':'-1', |
| | | 'limit': '-1', |
| | | ...masterParameter |
| | | }).then(res => { |
| | | this.masterData = res.data.records; |
| | |
| | | this.KeySelectLIst = [] |
| | | this.$set(this.TreeAddform, 'codeKeyAttrRepeatOidName', this.KeyName) |
| | | this.$set(this.TreeAddform, 'codeKeyAttrRepeatOid', this.KeyOid) |
| | | this.masterRow=null; |
| | | this.masterRow = null; |
| | | } |
| | | }, |
| | | //å
³é®å±æ§æ¥è¯¢ |
| | |
| | | referType: 'codekeyattrrepeat', |
| | | isMuti: 'false', |
| | | 'conditionMap["lcstatus"]': 'Enabled', |
| | | 'limit':'-1', |
| | | 'limit': '-1', |
| | | ...masterParameter |
| | | }).then(res => { |
| | | this.KeyData = res.data.records; |
| | |
| | | this.$set(this.TreeAddform, 'codeResembleRuleOidName', this.simName) |
| | | this.$set(this.TreeAddform, 'codeResembleRuleOid', this.simOid) |
| | | this.$emit('MasterHandler', this.loneTreeNewForm) |
| | | this.masterRow=null; |
| | | this.masterRow = null; |
| | | } |
| | | }, |
| | | //ç¸ä¼¼é¡¹æ¥è¯¢ |
| | |
| | | referType: 'coderesemblerule', |
| | | isMuti: 'false', |
| | | 'conditionMap["lcstatus"]': 'Enabled', |
| | | 'limit':'-1', |
| | | 'limit': '-1', |
| | | ...masterParameter |
| | | }).then(res => { |
| | | this.simData = res.data.records; |
| | |
| | | this.$set(this.TreeAddform, 'btmTypeName', this.btmName) |
| | | this.$set(this.TreeAddform, 'btmTypeId', this.btmOid) |
| | | this.$emit('MasterHandler', this.loneTreeNewForm) |
| | | this.masterRow=null; |
| | | this.masterRow = null; |
| | | } |
| | | }, |
| | | //ä¸å¡ç±»åæ¥è¯¢ |
| | |
| | | }, |
| | | //ä¸å¡ç±»åæ¥å£ |
| | | btmdefaultRend(masterParameter) { |
| | | referDataGrid({valueField: 'id', isMuti: 'false','limit':'-1', ...masterParameter}).then(res => { |
| | | referDataGrid({valueField: 'id', isMuti: 'false', 'limit': '-1', ...masterParameter}).then(res => { |
| | | this.BtmData = res.data.data.records |
| | | }) |
| | | }, |
| | |
| | | }, |
| | | //åç±»æ æ°æ®å¤ç |
| | | getAttr() { |
| | | getAtrrList().then(res => { |
| | | this.Treedata = res.data; |
| | | this.CloneTreedata = res.data; |
| | | this.Treedata.forEach(() => { |
| | | for (let i = 0; i < this.Treedata.length; i++) { |
| | | this.Treedata[i].value = i; |
| | | } |
| | | }) |
| | | //è°ç¨ä¿®æ¹å±æ§åæ¹æ³ |
| | | this.ModifyProperties(this.CloneTreedata, 'name', 'label'); |
| | | this.CloneTreedata = this.CloneTreedata.map(item => { |
| | | if (item.attributes.lcStatus === "Disabled") { |
| | | item.label += 'ãåç¨ã'; |
| | | } |
| | | return item; |
| | | }); |
| | | }).catch(res => { |
| | | this.$message.error(res) |
| | | |
| | | }) |
| | | this.loading = true; |
| | | return new Promise((resolve, reject) => { |
| | | getAtrrList() |
| | | .then(res => { |
| | | this.Treedata = res.data; |
| | | this.CloneTreedata = res.data; |
| | | this.Treedata.forEach(() => { |
| | | for (let i = 0; i < this.Treedata.length; i++) { |
| | | this.Treedata[i].value = i; |
| | | } |
| | | }) |
| | | //è°ç¨ä¿®æ¹å±æ§åæ¹æ³ |
| | | this.ModifyProperties(this.CloneTreedata, 'name', 'label'); |
| | | this.CloneTreedata = this.CloneTreedata.map(item => { |
| | | if (item.attributes.lcStatus === "Disabled") { |
| | | item.label += 'ãåç¨ã'; |
| | | } |
| | | return item; |
| | | }); |
| | | this.loading = false; |
| | | resolve(); // å®æè¯·æ±ï¼è°ç¨resolveæ¹æ³ |
| | | }) |
| | | .catch(error => { |
| | | this.$message.error(error) |
| | | reject(error); // 请æ±åºéï¼è°ç¨rejectæ¹æ³ |
| | | }); |
| | | }); |
| | | }, |
| | | //å®ä¹ä¸ä¸ªä¿®æ¹æ°æ®å±æ§åçæ¹æ³ |
| | | ModifyProperties(obj, oldName, newName) { |
| | |
| | | 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() |
| | | setTimeout(() => { |
| | | this.loading = false; |
| | | async flushed() { |
| | | await this.getAttr() |
| | | this.$refs.tree.setCurrentKey(null); |
| | | this.nodeClickList = {} |
| | | this.TreeList = [] |
| | | this.TreeFlagCode = true; |
| | | }, 600); |
| | | }, |
| | | //å¯ç¨ååç¨é½å
å¤æç¶æ |
| | | //å¯ç¨ |
| | | Enable() { |
| | | async Enable() { |
| | | if (Object.keys(this.nodeClickList).length < 1) { |
| | | this.$message.warning('请å
仿 ä¸éæ©ä¸æ¡æ°æ®') |
| | | } else { |
| | | if (this.FlagObj.lcStatus == "Enabled") { |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: 'å½ååç±»ä¸æ¯åç¨ç¶æ' |
| | | }); |
| | | } else { |
| | | this.$confirm('æ¯å¦å°ååç±»ä¸å¹¶å¯ç¨ï¼', 'æç¤º', { |
| | | confirmButtonText: 'æ¯', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | TreeEnable(this.nodeClickList).then(() => { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'å¯ç¨æå!' |
| | | }); |
| | | this.getAttr() |
| | | }) |
| | | }).catch(() => { |
| | | this.$message.warning('请å
仿 ä¸éæ©ä¸æ¡æ°æ®'); |
| | | return; |
| | | } |
| | | if (this.FlagObj.lcStatus == "Enabled") { |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: 'å½ååç±»ä¸æ¯åç¨ç¶æ' |
| | | }); |
| | | return; |
| | | } |
| | | this.loading = true; |
| | | try { |
| | | const confirmResult = await this.$confirm('æ¯å¦å°ååç±»ä¸å¹¶å¯ç¨ï¼', 'æç¤º', { |
| | | confirmButtonText: 'æ¯', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }); |
| | | if (confirmResult) { |
| | | await TreeEnable(this.nodeClickList).then(res => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å¯ç¨' |
| | | type: 'success', |
| | | message: 'å¯ç¨æå!' |
| | | }); |
| | | }) |
| | | await this.getAttr(); |
| | | |
| | | } else { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å¯ç¨' |
| | | }); |
| | | } |
| | | } catch (error) { |
| | | console.error(error); |
| | | } finally { |
| | | this.loading = false; |
| | | } |
| | | }, |
| | | |
| | | async Deactivate() { |
| | | if (Object.keys(this.nodeClickList).length < 1) { |
| | | this.$message.warning('请å
仿 ä¸éæ©ä¸æ¡æ°æ®'); |
| | | return; |
| | | } |
| | | |
| | | }, |
| | | //åç¨ |
| | | Deactivate() { |
| | | if (Object.keys(this.nodeClickList).length < 1) { |
| | | this.$message.warning('请å
仿 ä¸éæ©ä¸æ¡æ°æ®') |
| | | } else { |
| | | if (this.FlagObj.lcStatus === "Disabled") { |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: 'å½ååç±»ä¸æ¯å¯ç¨ç¶æ!' |
| | | }); |
| | | } else { |
| | | this.$confirm('æ¯å¦åç¨å½ååç±»ï¼åç¨åï¼ååç±»ä¹å°ä¸è½è¢«ä½¿ç¨ï¼æ¯å¦ç»§ç»ï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | TreeDeactivate(this.nodeClickList).then(() => { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'åç¨æå!' |
| | | }); |
| | | this.nodeClickList['flag'] = true; |
| | | this.getAttr() |
| | | }) |
| | | }).catch(() => { |
| | | if (this.FlagObj.lcStatus === "Disabled") { |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: 'å½ååç±»ä¸æ¯å¯ç¨ç¶æ!' |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | this.loading = true; |
| | | try { |
| | | const confirmResult = await this.$confirm('æ¯å¦åç¨å½ååç±»ï¼åç¨åï¼ååç±»ä¹å°ä¸è½è¢«ä½¿ç¨ï¼æ¯å¦ç»§ç»ï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }); |
| | | if (confirmResult) { |
| | | await TreeDeactivate(this.nodeClickList).then(res => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶åç¨' |
| | | type: 'success', |
| | | message: 'åç¨æå!' |
| | | }); |
| | | }) |
| | | this.nodeClickList['flag'] = true; |
| | | await this.getAttr(); |
| | | } else { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶åç¨' |
| | | }); |
| | | } |
| | | } catch (error) { |
| | | console.error(error); |
| | | } finally { |
| | | this.loading = false; |
| | | } |
| | | }, |
| | | //æ ç¹å»äºä»¶ |
| | |
| | | this.crudOid = '' |
| | | } |
| | | this.TreeList = res3.data.data; |
| | | if(this.TreeList.isParticipateCheck === null || this.TreeList.isParticipateCheck === undefined ||this.TreeList.isParticipateCheck === ""){ |
| | | this.$set(this.TreeList,"isParticipateCheck",1) |
| | | if (this.TreeList.isParticipateCheck === null || this.TreeList.isParticipateCheck === undefined || this.TreeList.isParticipateCheck === "") { |
| | | this.$set(this.TreeList, "isParticipateCheck", 1) |
| | | return |
| | | } |
| | | } catch (error) { |