分离业务

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`, 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获取题目信息 getSubjectInfo: `${host}/judgment/lcSubject/getSubjectInfo`, // 根据题目id获取题目信息
addJudgmentRule: `${host}/judgment/lcJudgmentRule/addJudgmentRule`, // 添加判分点规则 addJudgmentRule: `${host}/judgment/lcJudgmentRule/addJudgmentRule`, // 添加判分点规则
updateJudgmentRule: `${host}/judgment/lcJudgmentRule/updateJudgmentRule`, // 添加判分点规则 updateJudgmentRule: `${host}/judgment/lcJudgmentRule/updateJudgmentRule`, // 添加判分点规则

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

Loading…
Cancel
Save