|
|
|
@ -84,6 +84,12 @@ |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<el-card shadow="hover"> |
|
|
|
|
<div class="business"> |
|
|
|
|
<div class="label">业务</div> |
|
|
|
|
<el-select v-model="formData.lcJudgmentPoint.business" placeholder="请选择业务"> |
|
|
|
|
<el-option v-for="(item, i) in businessList" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</div> |
|
|
|
|
<el-table |
|
|
|
|
class="lc-table" |
|
|
|
|
:data="tableData" |
|
|
|
@ -380,8 +386,10 @@ export default { |
|
|
|
|
label: "name" |
|
|
|
|
}, // 树结构配置项 |
|
|
|
|
currentNodeData: {}, // 当前选中的节点 |
|
|
|
|
businessList: [], |
|
|
|
|
formData: { |
|
|
|
|
lcJudgmentPoint: { |
|
|
|
|
business: '', |
|
|
|
|
name: "", |
|
|
|
|
experimentalRequirements: "", |
|
|
|
|
isDel: 0, |
|
|
|
@ -411,6 +419,7 @@ export default { |
|
|
|
|
this.$route.query.token && this.$store.commit("setParam", { |
|
|
|
|
token: atob(decodeURI(this.$route.query.token)) |
|
|
|
|
}); |
|
|
|
|
this.getBusiness() |
|
|
|
|
this.checkChange.push(false) |
|
|
|
|
this.getTreeData(); |
|
|
|
|
if (this.$route.query.systemId) { |
|
|
|
@ -427,26 +436,23 @@ export default { |
|
|
|
|
lcJudgmentPoint: judgmentPoint, |
|
|
|
|
lcJudgmentRuleList: judgmentRuleList |
|
|
|
|
}; |
|
|
|
|
this.$set(this.formData.lcJudgmentPoint, 'business', +judgmentRuleList[0].operationIds.split(',')[1]) // 业务id取operationIds的第二个id,第一个是固定的285 |
|
|
|
|
this.anewPosttingData(judgmentRuleList) |
|
|
|
|
this.tableData.forEach(async (item, index) => { |
|
|
|
|
// 勾选树节点 |
|
|
|
|
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<list.length; i++) { |
|
|
|
|
if(list[i].id == startId) { |
|
|
|
|
testObj = list[i] |
|
|
|
|
findOut = this.cxk(idArr, list[i], testObj) |
|
|
|
|
const id = item.operationIds.split(',') |
|
|
|
|
if(list[i].id == id[0]) { |
|
|
|
|
findOut = this.filterRule(id, list, testObj) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
item.operationIData.push(testObj) |
|
|
|
|
item.operationIData.push(testObj.children[0]) |
|
|
|
|
} |
|
|
|
|
// 根据题目id,获取题目信息 |
|
|
|
|
if (item.isSubject && item.type && item.type != 4 && item.emptyOne) { |
|
|
|
@ -464,17 +470,20 @@ export default { |
|
|
|
|
// console.log(err); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 获取业务 |
|
|
|
|
getBusiness() { |
|
|
|
|
this.$post(this.api.getAllBusiness).then(({ lcRecords }) => { |
|
|
|
|
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<list.length; i++) { |
|
|
|
|
if(list[i].id == startId) { |
|
|
|
|
testObj = list[i] |
|
|
|
|
findOut = this.cxk(idArr, list[i], testObj) |
|
|
|
|
let id = item.operationIds.split(',') |
|
|
|
|
if(list[i].id == id[0]) { |
|
|
|
|
findOut = this.filterRule(id, list, testObj) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
item.operationIData.push(testObj) |
|
|
|
|
testObj.children && item.operationIData.push(testObj.children[0]) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.setIndex() |
|
|
|
@ -596,6 +600,7 @@ export default { |
|
|
|
|
isDisabled: true, // 已禁用 |
|
|
|
|
isSave: true // 已保存 |
|
|
|
|
}; |
|
|
|
|
obj.operationIds = obj.operationIds.split(',').slice(2).join() |
|
|
|
|
if(item.type == undefined || item.type == ''){ |
|
|
|
|
obj.type = null |
|
|
|
|
}else{ |
|
|
|
@ -679,18 +684,18 @@ export default { |
|
|
|
|
getTreeData() { // 获取树结构数据 |
|
|
|
|
if(this.treeDataStore.length) { |
|
|
|
|
const tmp = deepCopy(this.treeDataStore) |
|
|
|
|
this.treeData = this.toTreeId(tmp, this.treeDataStore[0].parentId); |
|
|
|
|
this.treeData = this.toTreeId(tmp); |
|
|
|
|
if (this.$route.query.lcId) { |
|
|
|
|
this.lcId = this.$route.query.lcId; |
|
|
|
|
this.getInfoData(this.$route.query.lcId); |
|
|
|
|
} |
|
|
|
|
this.loading = false |
|
|
|
|
}else { |
|
|
|
|
this.$get(this.api.getLcRecord).then(res => { |
|
|
|
|
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 { |
|
|
|
|