diff --git a/src/utils/api.js b/src/utils/api.js index 7929fa6..dc17800 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -32,7 +32,8 @@ export default { fileupload: `${uploadURL}/oss/manage/fileupload`, // 交易类(流程类) - getLcRecord: `${host}/judgment/lcRecord/getLcRecord`, // 获取流程记录列表(树) + getAllBusiness: `${host}/judgment/lcRecord/getAllBusiness`, // 获取流程记录列表(树) + getProcess: `${host}/judgment/lcRecord/getProcess`, // 获取流程记录列表(树) getSubjectInfo: `${host}/judgment/lcSubject/getSubjectInfo`, // 根据题目id获取题目信息 addJudgmentRule: `${host}/judgment/lcJudgmentRule/addJudgmentRule`, // 添加判分点规则 updateJudgmentRule: `${host}/judgment/lcJudgmentRule/updateJudgmentRule`, // 添加判分点规则 diff --git a/src/views/Transaction.vue b/src/views/Transaction.vue index 107d739..f35b8a1 100644 --- a/src/views/Transaction.vue +++ b/src/views/Transaction.vue @@ -84,6 +84,12 @@ +
+
业务
+ + + +
{ // 勾选树节点 let lists = JSON.parse(JSON.stringify(this.treeData)) if (item.operationIds) { let list = lists - let idstr = item.operationIds item.operationIData = [] - let idArr = idstr.split(',') - idArr.shift() - let startId = idArr.shift() let findOut = null - let testObj = null + let testObj = {} for(let i=0; i { + this.businessList = lcRecords + }).catch(res => {}) + }, handleSelectionChange(val){ this.multipleSelection = val }, - cxk(arr, obj, needObj) { - if(arr.length === 0) { - return obj - } - let findIt = arr.shift() - let tmp = obj.children.find(item => item.id == findIt) - needObj.children = obj.children.filter(item => item.id == findIt) - return this.cxk(arr, tmp, needObj.children[0]) + filterRule(id, obj, needObj) { + let first = id.shift() + let tmp = obj.find(item => item.id == first) + needObj.children = obj.filter(item => item.id == first) + if (tmp) return this.filterRule(id, tmp.children, needObj.children.length ? needObj.children[0] : []) }, //计算此节点的距离思路1.计算出当前节点据顶部的高度+当前节点在树的位置的高度-盒子高度的一半 scrollToDepTree(deptCode){ @@ -505,23 +514,18 @@ export default { if (!item.type){ this.getSubjectData(item.subjectId, index); } - let lists = JSON.parse(JSON.stringify(this.treeData)) if (item.operationIds) { - let list = lists - let idstr = item.operationIds + let list = JSON.parse(JSON.stringify(this.treeData)) item.operationIData = [] - let idArr = idstr.split(',') - idArr.shift() - let startId = idArr.shift() + let testObj = {} let findOut = null - let testObj = null for(let i=0; i { - if (res.status == 200 && res.list.length>0) { - if (res.list.length>0) { - this.$store.commit('setTreeDataStore', { treeDataStore: res.list}) - this.treeData = this.toTreeId(res.list, res.list[0].parentId); + this.$post(this.api.getProcess).then(({ process, status, message }) => { + if (status == 200) { + if (process.length) { + this.$store.commit('setTreeDataStore', { treeDataStore: process}) + this.treeData = this.toTreeId(process); this.loading = false if (this.$route.query.lcId) { this.lcId = this.$route.query.lcId; @@ -698,31 +703,12 @@ export default { } } } else { - this.$message.warning(res.message); + this.$message.warning(message); } }).catch(err => { this.loading = false }); } - - - // this.$get(this.api.getLcRecord).then(res => { - // if (res.status == 200 && res.list.length>0) { - // if (res.list.length>0) { - // this.treeData = this.toTreeId(res.list, res.list[0].parentId); - // if (this.$route.query.lcId) { - // this.lcId = this.$route.query.lcId; - // this.getInfoData(this.$route.query.lcId); - // } else { - // this.loading = false - // } - // } - // } else { - // this.$message.warning(res.message); - // } - // }).catch(err => { - // // console.log(err); - // }); }, toTreeId(data, parentId) { // id重新串连成(父+子+孙),已便达到树节点需要的key唯一性,且后面提交数据,需要传这个id串到后台 let result = []; @@ -733,15 +719,8 @@ export default { } else { item.showCheckbox = true; } - if (item.children && item.children.length) { - // item.id = `${parentId},${item.id}`; - item.operationIds = `${parentId},${item.id}`; - - item.children = this.toTreeId(item.children, item.operationIds); - } else { - // item.id = `${parentId},${item.id}`; - item.operationIds = `${parentId},${item.id}`; - } + item.operationIds = parentId ? `${parentId},${item.id}` : `${item.id}` + if (item.children && item.children.length) item.children = this.toTreeId(item.children, item.operationIds) result.push(item); }); return result; @@ -767,7 +746,8 @@ export default { } }, saveAll() { // 保存判分点 - if (!this.formData.lcJudgmentPoint.name) { + const point = this.formData.lcJudgmentPoint + if (!point.name) { this.$message.warning(`判分点名称不能为空`); return; } @@ -775,7 +755,11 @@ export default { this.$message.warning(`当前判分点名称已存在`); return; } - if (!this.formData.lcJudgmentPoint.experimentalRequirements) { + if (!point.business) { + this.$message.warning(`请选择业务`); + return; + } + if (!point.experimentalRequirements) { this.$message.warning(`实验要求不能为空`); return; } @@ -804,7 +788,7 @@ export default { lcId: i.lcId, itemId:'', type: i.type ? i.type : "", - operationIds: i.operationIds, + operationIds: `285,${point.business},${i.operationIds}`, resultOperation: i.resultOperation, ruleOperation: i.ruleOperation }; @@ -1121,6 +1105,14 @@ export default { margin: auto; text-align: center; } + .business { + display: flex; + align-items: center; + margin-bottom: 10px; + .label { + margin-right: 10px; + } + } // 表单容器 .form-con { padding-bottom: 24px; @@ -1218,7 +1210,7 @@ export default { bottom: 0; right: 10px; cursor: not-allowed; - z-index: 99999; + z-index: 100; } } /deep/.lc-table {