分离业务

master
yujialong 3 years ago
parent e8c7b98254
commit 1794eb4784
  1. 3
      src/utils/api.js
  2. 126
      src/views/Transaction.vue

@ -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`, // 添加判分点规则

@ -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]) // idoperationIdsid285
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 {

Loading…
Cancel
Save