|
|
@ -84,6 +84,12 @@ |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<el-card shadow="hover"> |
|
|
|
<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 |
|
|
|
<el-table |
|
|
|
class="lc-table" |
|
|
|
class="lc-table" |
|
|
|
:data="tableData" |
|
|
|
:data="tableData" |
|
|
@ -380,8 +386,10 @@ export default { |
|
|
|
label: "name" |
|
|
|
label: "name" |
|
|
|
}, // 树结构配置项 |
|
|
|
}, // 树结构配置项 |
|
|
|
currentNodeData: {}, // 当前选中的节点 |
|
|
|
currentNodeData: {}, // 当前选中的节点 |
|
|
|
|
|
|
|
businessList: [], |
|
|
|
formData: { |
|
|
|
formData: { |
|
|
|
lcJudgmentPoint: { |
|
|
|
lcJudgmentPoint: { |
|
|
|
|
|
|
|
business: '', |
|
|
|
name: "", |
|
|
|
name: "", |
|
|
|
experimentalRequirements: "", |
|
|
|
experimentalRequirements: "", |
|
|
|
isDel: 0, |
|
|
|
isDel: 0, |
|
|
@ -411,6 +419,7 @@ export default { |
|
|
|
this.$route.query.token && this.$store.commit("setParam", { |
|
|
|
this.$route.query.token && this.$store.commit("setParam", { |
|
|
|
token: atob(decodeURI(this.$route.query.token)) |
|
|
|
token: atob(decodeURI(this.$route.query.token)) |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
this.getBusiness() |
|
|
|
this.checkChange.push(false) |
|
|
|
this.checkChange.push(false) |
|
|
|
this.getTreeData(); |
|
|
|
this.getTreeData(); |
|
|
|
if (this.$route.query.systemId) { |
|
|
|
if (this.$route.query.systemId) { |
|
|
@ -427,26 +436,23 @@ export default { |
|
|
|
lcJudgmentPoint: judgmentPoint, |
|
|
|
lcJudgmentPoint: judgmentPoint, |
|
|
|
lcJudgmentRuleList: judgmentRuleList |
|
|
|
lcJudgmentRuleList: judgmentRuleList |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
this.$set(this.formData.lcJudgmentPoint, 'business', +judgmentRuleList[0].operationIds.split(',')[1]) // 业务id取operationIds的第二个id,第一个是固定的285 |
|
|
|
this.anewPosttingData(judgmentRuleList) |
|
|
|
this.anewPosttingData(judgmentRuleList) |
|
|
|
this.tableData.forEach(async (item, index) => { |
|
|
|
this.tableData.forEach(async (item, index) => { |
|
|
|
// 勾选树节点 |
|
|
|
// 勾选树节点 |
|
|
|
let lists = JSON.parse(JSON.stringify(this.treeData)) |
|
|
|
let lists = JSON.parse(JSON.stringify(this.treeData)) |
|
|
|
if (item.operationIds) { |
|
|
|
if (item.operationIds) { |
|
|
|
let list = lists |
|
|
|
let list = lists |
|
|
|
let idstr = item.operationIds |
|
|
|
|
|
|
|
item.operationIData = [] |
|
|
|
item.operationIData = [] |
|
|
|
let idArr = idstr.split(',') |
|
|
|
|
|
|
|
idArr.shift() |
|
|
|
|
|
|
|
let startId = idArr.shift() |
|
|
|
|
|
|
|
let findOut = null |
|
|
|
let findOut = null |
|
|
|
let testObj = null |
|
|
|
let testObj = {} |
|
|
|
for(let i=0; i<list.length; i++) { |
|
|
|
for(let i=0; i<list.length; i++) { |
|
|
|
if(list[i].id == startId) { |
|
|
|
const id = item.operationIds.split(',') |
|
|
|
testObj = list[i] |
|
|
|
if(list[i].id == id[0]) { |
|
|
|
findOut = this.cxk(idArr, list[i], testObj) |
|
|
|
findOut = this.filterRule(id, list, testObj) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
item.operationIData.push(testObj) |
|
|
|
item.operationIData.push(testObj.children[0]) |
|
|
|
} |
|
|
|
} |
|
|
|
// 根据题目id,获取题目信息 |
|
|
|
// 根据题目id,获取题目信息 |
|
|
|
if (item.isSubject && item.type && item.type != 4 && item.emptyOne) { |
|
|
|
if (item.isSubject && item.type && item.type != 4 && item.emptyOne) { |
|
|
@ -464,17 +470,20 @@ export default { |
|
|
|
// console.log(err); |
|
|
|
// console.log(err); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取业务 |
|
|
|
|
|
|
|
getBusiness() { |
|
|
|
|
|
|
|
this.$post(this.api.getAllBusiness).then(({ lcRecords }) => { |
|
|
|
|
|
|
|
this.businessList = lcRecords |
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
|
|
|
|
}, |
|
|
|
handleSelectionChange(val){ |
|
|
|
handleSelectionChange(val){ |
|
|
|
this.multipleSelection = val |
|
|
|
this.multipleSelection = val |
|
|
|
}, |
|
|
|
}, |
|
|
|
cxk(arr, obj, needObj) { |
|
|
|
filterRule(id, obj, needObj) { |
|
|
|
if(arr.length === 0) { |
|
|
|
let first = id.shift() |
|
|
|
return obj |
|
|
|
let tmp = obj.find(item => item.id == first) |
|
|
|
} |
|
|
|
needObj.children = obj.filter(item => item.id == first) |
|
|
|
let findIt = arr.shift() |
|
|
|
if (tmp) return this.filterRule(id, tmp.children, needObj.children.length ? needObj.children[0] : []) |
|
|
|
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]) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
//计算此节点的距离思路1.计算出当前节点据顶部的高度+当前节点在树的位置的高度-盒子高度的一半 |
|
|
|
//计算此节点的距离思路1.计算出当前节点据顶部的高度+当前节点在树的位置的高度-盒子高度的一半 |
|
|
|
scrollToDepTree(deptCode){ |
|
|
|
scrollToDepTree(deptCode){ |
|
|
@ -505,23 +514,18 @@ export default { |
|
|
|
if (!item.type){ |
|
|
|
if (!item.type){ |
|
|
|
this.getSubjectData(item.subjectId, index); |
|
|
|
this.getSubjectData(item.subjectId, index); |
|
|
|
} |
|
|
|
} |
|
|
|
let lists = JSON.parse(JSON.stringify(this.treeData)) |
|
|
|
|
|
|
|
if (item.operationIds) { |
|
|
|
if (item.operationIds) { |
|
|
|
let list = lists |
|
|
|
let list = JSON.parse(JSON.stringify(this.treeData)) |
|
|
|
let idstr = item.operationIds |
|
|
|
|
|
|
|
item.operationIData = [] |
|
|
|
item.operationIData = [] |
|
|
|
let idArr = idstr.split(',') |
|
|
|
let testObj = {} |
|
|
|
idArr.shift() |
|
|
|
|
|
|
|
let startId = idArr.shift() |
|
|
|
|
|
|
|
let findOut = null |
|
|
|
let findOut = null |
|
|
|
let testObj = null |
|
|
|
|
|
|
|
for(let i=0; i<list.length; i++) { |
|
|
|
for(let i=0; i<list.length; i++) { |
|
|
|
if(list[i].id == startId) { |
|
|
|
let id = item.operationIds.split(',') |
|
|
|
testObj = list[i] |
|
|
|
if(list[i].id == id[0]) { |
|
|
|
findOut = this.cxk(idArr, list[i], testObj) |
|
|
|
findOut = this.filterRule(id, list, testObj) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
item.operationIData.push(testObj) |
|
|
|
testObj.children && item.operationIData.push(testObj.children[0]) |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.setIndex() |
|
|
|
this.setIndex() |
|
|
@ -596,6 +600,7 @@ export default { |
|
|
|
isDisabled: true, // 已禁用 |
|
|
|
isDisabled: true, // 已禁用 |
|
|
|
isSave: true // 已保存 |
|
|
|
isSave: true // 已保存 |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
obj.operationIds = obj.operationIds.split(',').slice(2).join() |
|
|
|
if(item.type == undefined || item.type == ''){ |
|
|
|
if(item.type == undefined || item.type == ''){ |
|
|
|
obj.type = null |
|
|
|
obj.type = null |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
@ -679,18 +684,18 @@ export default { |
|
|
|
getTreeData() { // 获取树结构数据 |
|
|
|
getTreeData() { // 获取树结构数据 |
|
|
|
if(this.treeDataStore.length) { |
|
|
|
if(this.treeDataStore.length) { |
|
|
|
const tmp = deepCopy(this.treeDataStore) |
|
|
|
const tmp = deepCopy(this.treeDataStore) |
|
|
|
this.treeData = this.toTreeId(tmp, this.treeDataStore[0].parentId); |
|
|
|
this.treeData = this.toTreeId(tmp); |
|
|
|
if (this.$route.query.lcId) { |
|
|
|
if (this.$route.query.lcId) { |
|
|
|
this.lcId = this.$route.query.lcId; |
|
|
|
this.lcId = this.$route.query.lcId; |
|
|
|
this.getInfoData(this.$route.query.lcId); |
|
|
|
this.getInfoData(this.$route.query.lcId); |
|
|
|
} |
|
|
|
} |
|
|
|
this.loading = false |
|
|
|
this.loading = false |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
this.$get(this.api.getLcRecord).then(res => { |
|
|
|
this.$post(this.api.getProcess).then(({ process, status, message }) => { |
|
|
|
if (res.status == 200 && res.list.length>0) { |
|
|
|
if (status == 200) { |
|
|
|
if (res.list.length>0) { |
|
|
|
if (process.length) { |
|
|
|
this.$store.commit('setTreeDataStore', { treeDataStore: res.list}) |
|
|
|
this.$store.commit('setTreeDataStore', { treeDataStore: process}) |
|
|
|
this.treeData = this.toTreeId(res.list, res.list[0].parentId); |
|
|
|
this.treeData = this.toTreeId(process); |
|
|
|
this.loading = false |
|
|
|
this.loading = false |
|
|
|
if (this.$route.query.lcId) { |
|
|
|
if (this.$route.query.lcId) { |
|
|
|
this.lcId = this.$route.query.lcId; |
|
|
|
this.lcId = this.$route.query.lcId; |
|
|
@ -698,31 +703,12 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.$message.warning(res.message); |
|
|
|
this.$message.warning(message); |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
|
this.loading = false |
|
|
|
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串到后台 |
|
|
|
toTreeId(data, parentId) { // id重新串连成(父+子+孙),已便达到树节点需要的key唯一性,且后面提交数据,需要传这个id串到后台 |
|
|
|
let result = []; |
|
|
|
let result = []; |
|
|
@ -733,15 +719,8 @@ export default { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
item.showCheckbox = true; |
|
|
|
item.showCheckbox = true; |
|
|
|
} |
|
|
|
} |
|
|
|
if (item.children && item.children.length) { |
|
|
|
item.operationIds = parentId ? `${parentId},${item.id}` : `${item.id}` |
|
|
|
// item.id = `${parentId},${item.id}`; |
|
|
|
if (item.children && item.children.length) item.children = this.toTreeId(item.children, item.operationIds) |
|
|
|
item.operationIds = `${parentId},${item.id}`; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
item.children = this.toTreeId(item.children, item.operationIds); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// item.id = `${parentId},${item.id}`; |
|
|
|
|
|
|
|
item.operationIds = `${parentId},${item.id}`; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
result.push(item); |
|
|
|
result.push(item); |
|
|
|
}); |
|
|
|
}); |
|
|
|
return result; |
|
|
|
return result; |
|
|
@ -767,7 +746,8 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
saveAll() { // 保存判分点 |
|
|
|
saveAll() { // 保存判分点 |
|
|
|
if (!this.formData.lcJudgmentPoint.name) { |
|
|
|
const point = this.formData.lcJudgmentPoint |
|
|
|
|
|
|
|
if (!point.name) { |
|
|
|
this.$message.warning(`判分点名称不能为空`); |
|
|
|
this.$message.warning(`判分点名称不能为空`); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -775,7 +755,11 @@ export default { |
|
|
|
this.$message.warning(`当前判分点名称已存在`); |
|
|
|
this.$message.warning(`当前判分点名称已存在`); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!this.formData.lcJudgmentPoint.experimentalRequirements) { |
|
|
|
if (!point.business) { |
|
|
|
|
|
|
|
this.$message.warning(`请选择业务`); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!point.experimentalRequirements) { |
|
|
|
this.$message.warning(`实验要求不能为空`); |
|
|
|
this.$message.warning(`实验要求不能为空`); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -804,7 +788,7 @@ export default { |
|
|
|
lcId: i.lcId, |
|
|
|
lcId: i.lcId, |
|
|
|
itemId:'', |
|
|
|
itemId:'', |
|
|
|
type: i.type ? i.type : "", |
|
|
|
type: i.type ? i.type : "", |
|
|
|
operationIds: i.operationIds, |
|
|
|
operationIds: `285,${point.business},${i.operationIds}`, |
|
|
|
resultOperation: i.resultOperation, |
|
|
|
resultOperation: i.resultOperation, |
|
|
|
ruleOperation: i.ruleOperation |
|
|
|
ruleOperation: i.ruleOperation |
|
|
|
}; |
|
|
|
}; |
|
|
@ -1121,6 +1105,14 @@ export default { |
|
|
|
margin: auto; |
|
|
|
margin: auto; |
|
|
|
text-align: center; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.business { |
|
|
|
|
|
|
|
display: flex; |
|
|
|
|
|
|
|
align-items: center; |
|
|
|
|
|
|
|
margin-bottom: 10px; |
|
|
|
|
|
|
|
.label { |
|
|
|
|
|
|
|
margin-right: 10px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
// 表单容器 |
|
|
|
// 表单容器 |
|
|
|
.form-con { |
|
|
|
.form-con { |
|
|
|
padding-bottom: 24px; |
|
|
|
padding-bottom: 24px; |
|
|
@ -1218,7 +1210,7 @@ export default { |
|
|
|
bottom: 0; |
|
|
|
bottom: 0; |
|
|
|
right: 10px; |
|
|
|
right: 10px; |
|
|
|
cursor: not-allowed; |
|
|
|
cursor: not-allowed; |
|
|
|
z-index: 99999; |
|
|
|
z-index: 100; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
/deep/.lc-table { |
|
|
|
/deep/.lc-table { |
|
|
|