Compare commits
2 Commits
b9e45dd82c
...
2bed6ea74c
| Author | SHA1 | Date |
|---|---|---|
|
|
2bed6ea74c | |
|
|
73219c5c04 |
|
|
@ -51,7 +51,6 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
validate(call) {
|
||||
console.log("我被触发了")
|
||||
let success = true
|
||||
this.$refs.form.validate(valid => {
|
||||
success = valid
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-form class="process-form" label-position="top" :rules="rules" :model="_value">
|
||||
<el-form ref="formView" class="process-form" label-position="top" :rules="rules" :model="_value">
|
||||
<div v-for="(item, index) in formItems" :key="item.name + index">
|
||||
<el-form-item v-if="item.name !== 'SpanLayout' && item.name !== 'Description'"
|
||||
:prop="item.id" :label="item.title">
|
||||
|
|
@ -62,8 +62,35 @@ export default {
|
|||
this.loadFormConfig(this.formItems)
|
||||
},
|
||||
methods: {
|
||||
validate(call) {
|
||||
console.log("我被执行了")
|
||||
|
||||
let success = true
|
||||
this.$refs.formView.validate(valid => {
|
||||
success = valid
|
||||
if(valid){
|
||||
//校验成功再校验内部
|
||||
for (let i = 0; i < this.formItems.length; i++) {
|
||||
if (this.formItems[i].name === 'TableList'){
|
||||
let formRef = this.$refs[`sub-item_${this.formItems[i].id}`]
|
||||
if (formRef && Array.isArray(formRef) && formRef.length > 0){
|
||||
formRef[0].validate(subValid => {
|
||||
success = subValid
|
||||
})
|
||||
if (!success){
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
call(success)
|
||||
});
|
||||
},
|
||||
loadFormConfig(formItems) {
|
||||
console.log(formItems)
|
||||
formItems.forEach(item => {
|
||||
console.log(item.perm === 'E',item,"item")
|
||||
if (item.name === 'SpanLayout') {
|
||||
this.loadFormConfig(item.props.items)
|
||||
} else {
|
||||
|
|
@ -71,8 +98,11 @@ export default {
|
|||
if (this.isPreview) {
|
||||
this.$set(item, 'perm', this.model)
|
||||
}
|
||||
console.log(item.perm === 'E',item,"item")
|
||||
if (item.perm === 'E') {
|
||||
console.log("进去了")
|
||||
if (item.props.required) {
|
||||
console.log("开始制作权限了")
|
||||
this.$set(this.rules, item.id, [{
|
||||
type: item.valueType === 'Array' ? 'array' : undefined,
|
||||
required: true,
|
||||
|
|
@ -82,6 +112,7 @@ export default {
|
|||
}
|
||||
}
|
||||
})
|
||||
console.log(this.rules)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -169,13 +169,6 @@ export default {
|
|||
let that = this;
|
||||
this.init();
|
||||
getTaskInfo(taskId).then(res => {
|
||||
let data = res.data
|
||||
data.formItems.map(item => {
|
||||
if (item.props.required) {
|
||||
item.props.required = !item.props.required
|
||||
}
|
||||
return item
|
||||
})
|
||||
that.taskData = res.data;
|
||||
that.$store.state.design = that.taskData;
|
||||
that.$store.state.userTaskOption = that.taskData.userTaskOption;
|
||||
|
|
@ -183,15 +176,20 @@ export default {
|
|||
});
|
||||
},
|
||||
submitTask() {
|
||||
let params = {
|
||||
taskId: this.selectTask.taskId,
|
||||
formData: JSON.stringify(this.taskData.formData)
|
||||
};
|
||||
completeTask(params).then(res => {
|
||||
this.approveOpen = false;
|
||||
this.getList();
|
||||
this.$message.success(res.msg);
|
||||
});
|
||||
console.log("wqeqwqewqe")
|
||||
this.$refs.taskViewForm.validate(valid =>{
|
||||
if (valid){
|
||||
let params = {
|
||||
taskId: this.selectTask.taskId,
|
||||
formData: JSON.stringify(this.taskData.formData)
|
||||
};
|
||||
completeTask(params).then(res => {
|
||||
this.approveOpen = false;
|
||||
this.getList();
|
||||
this.$message.success(res.msg);
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
showCommentBox() {
|
||||
this.commentInfo = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
<script src="../../api/processInstance.js"></script>
|
||||
<template>
|
||||
<div>
|
||||
<el-table :data="tableData"
|
||||
|
|
@ -90,7 +89,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import FormRenderView from '@/views/common/form/FormRender'
|
||||
import FormRenderView from '@/views/common/form/FormRenderView'
|
||||
import ProcessDiagramViewer from "../admin/layout/ProcessDiagramViewer";
|
||||
import {getInitiatedInstanceList, getInitiatedInstanceInfo} from "@/api/processInstance";
|
||||
import {timeLength} from '@/utils/date'
|
||||
|
|
@ -134,7 +133,6 @@ export default {
|
|||
that.$store.state.endList = data.endList;
|
||||
that.$store.state.noTakeList = data.noTakeList;
|
||||
this.loading = false;
|
||||
console.log(data, "获取到的结果数据")
|
||||
})
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue